svn commit: r342470 - stable/12/sys/cam/scsi

Andriy Gapon avg at FreeBSD.org
Wed Dec 26 09:16:04 UTC 2018


Author: avg
Date: Wed Dec 26 09:16:03 2018
New Revision: 342470
URL: https://svnweb.freebsd.org/changeset/base/342470

Log:
  MFC r341681: daprobedone: announce if a disk is write-protected

Modified:
  stable/12/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cam/scsi/scsi_da.c
==============================================================================
--- stable/12/sys/cam/scsi/scsi_da.c	Wed Dec 26 07:57:21 2018	(r342469)
+++ stable/12/sys/cam/scsi/scsi_da.c	Wed Dec 26 09:16:03 2018	(r342470)
@@ -2457,6 +2457,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


More information about the svn-src-stable-12 mailing list