freebsd-dev/sys/cam/scsi
Andriy Gapon 6ce374aa94 geom_disk / scsi_da: deny opening write-protected disks for writing
Ths change consists of two parts.

geom_disk: deny opening a disk for writing if it's marked as
write-protected.  A new disk(9) flag is added to mark write protected
disks.  A possible alternative could be to add another parameter to d_open,
so that the open mode could be passed to it and the disk drivers could
make the decision internally, but the flag required less churn.

scsi_da: add a new phase of disk probing to query the all pages mode
sense page.  We can determine if the disk is write protected using bit 7
of the device specific field in the mode parameter header returned by
MODE SENSE.

PR:		224037
Reviewed by:	mav
MFC after:	4 weeks
Differential Revision: https://reviews.freebsd.org/D13360
2018-01-15 11:20:00 +00:00
..
scsi_all.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_all.h Add the SCSI Solid State Media Log page (0x11) definition. 2017-05-04 17:23:39 +00:00
scsi_cd.c Reduce size of several on-stack string buffers. 2017-12-13 21:17:00 +00:00
scsi_cd.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_ch.c Define xpt_path_inq. 2017-12-06 23:05:22 +00:00
scsi_ch.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_da.c geom_disk / scsi_da: deny opening write-protected disks for writing 2018-01-15 11:20:00 +00:00
scsi_da.h Improve support for informational exceptions. 2016-12-19 10:25:47 +00:00
scsi_dvcfg.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_enc_internal.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_enc_safte.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_enc_ses.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_enc.c Remove unused 4th argument to match the standard error routines. 2017-12-06 00:29:50 +00:00
scsi_enc.h Add API to obtain primary enclosure name and ID for /dev/sesX devices. 2015-11-21 10:22:01 +00:00
scsi_iu.h
scsi_low.c Remove ccbque.h from i386/isa. 2018-01-09 16:11:33 +00:00
scsi_low.h Remove ccbque.h from i386/isa. 2018-01-09 16:11:33 +00:00
scsi_message.h Add partial support for QUERY TMF to CAM and isp(4). 2015-10-23 18:34:18 +00:00
scsi_pass.c Do pass removing some write-only variables from the kernel. 2017-12-25 04:48:39 +00:00
scsi_pass.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_pt.c Define xpt_path_inq. 2017-12-06 23:05:22 +00:00
scsi_pt.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_sa.c Reduce size of several on-stack string buffers. 2017-12-13 21:17:00 +00:00
scsi_sa.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_ses.h Add support for EIIOE flag in Additional Element Status. 2016-11-07 18:21:53 +00:00
scsi_sg.c Define xpt_path_inq. 2017-12-06 23:05:22 +00:00
scsi_sg.h
scsi_targ_bh.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_target.c Define xpt_path_inq. 2017-12-06 23:05:22 +00:00
scsi_targetio.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
scsi_xpt.c Define xpt_path_inq. 2017-12-06 23:05:22 +00:00
smp_all.c sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00
smp_all.h sys/cam: further adoption of SPDX licensing ID tags. 2017-11-27 15:12:43 +00:00