summaryrefslogtreecommitdiff
path: root/sys/scsi/sd.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-07-08 14:31:00 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-07-08 14:31:00 +0000
commit887908b79c7ae681e8b2bb02279240af317262d5 (patch)
treeb7308c555d181eef75bcf31c0d747e006d2dd458 /sys/scsi/sd.c
parentb87977228a6f6a5a391c69fdfb2dc717d206ece4 (diff)
Return EROFS when a read-write mount of a read-only sd(4) device
is attempted. This is instead of the current EACCES and is intended to result in better error messages from mount(8). Tweak default EROFS error text to mention fsck'ing in mount_ext2fs and mount_msdos since they both have fsck's like ffs. ok deraadt@ aja@ ian@ phessler@
Diffstat (limited to 'sys/scsi/sd.c')
-rw-r--r--sys/scsi/sd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index e7171c16729..fe94b7b8a47 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.240 2012/06/10 21:29:04 krw Exp $ */
+/* $OpenBSD: sd.c,v 1.241 2012/07/08 14:30:59 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -353,7 +353,7 @@ sdopen(dev_t dev, int flag, int fmt, struct proc *p)
}
if (ISSET(flag, FWRITE) && ISSET(sc_link->flags, SDEV_READONLY)) {
device_unref(&sc->sc_dev);
- return (EACCES);
+ return (EROFS);
}
SC_DEBUG(sc_link, SDEV_DB1,