From 2e2b365e47fa5cd295d014401aea3ba8fe427018 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Fri, 7 Dec 2018 12:02:31 +0000 Subject: [PATCH] daprobedone: announce if a disk is write-protected MFC after: 2 weeks --- sys/cam/scsi/scsi_da.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 9a52812fbf4..423444094c3 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -2472,6 +2472,11 @@ daprobedone(struct cam_periph *periph, union ccb *ccb) printf("%s%d: %s\n", periph->periph_name, periph->unit_number, buf); } + if ((softc->disk->d_flags & DISKFLAG_WRITE_PROTECT) != 0 && + (softc->flags & DA_FLAG_ANNOUNCED) == 0) { + printf("%s%d: Write Protected\n", periph->periph_name, + periph->unit_number); + } /* * Since our peripheral may be invalidated by an error