summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Hall <halex@cvs.openbsd.org>2014-02-13 05:51:07 +0000
committerAlexander Hall <halex@cvs.openbsd.org>2014-02-13 05:51:07 +0000
commit1f4b503b6ef7c8b31374219d2736c5c6c9907bb9 (patch)
tree91d275456a781f7fa1ccc4ccbf98b8759791d5e5
parentf064eeb2568b9a5d36899271596c4da366f8d2ab (diff)
if an attached sd(4) is readonly, make sure it's noticable in the
dmesg, or write operations just fail with EACCES for no obvious reason ok krw@ tedu@
-rw-r--r--sys/scsi/sd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index da02600c0ea..2e93ed0b1a6 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.251 2013/11/01 17:36:19 krw Exp $ */
+/* $OpenBSD: sd.c,v 1.252 2014/02/13 05:51:06 halex Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -233,6 +233,9 @@ sdattach(struct device *parent, struct device *self, void *aux)
sortby = BUFQ_FIFO;
printf(", thin");
}
+ if (ISSET(sc_link->flags, SDEV_READONLY)) {
+ printf(", readonly");
+ }
printf("\n");
break;