From 1f4b503b6ef7c8b31374219d2736c5c6c9907bb9 Mon Sep 17 00:00:00 2001 From: Alexander Hall Date: Thu, 13 Feb 2014 05:51:07 +0000 Subject: 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@ --- sys/scsi/sd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3