scsi: sd: only print initial write protect status if enabled
PATCH 1/1 scsi: sd: only print initial write protect status if enabled
Having a write protect status of zero is generally the assumed state when a scsi attached disk is presented to the kernel. For this reason, only print the state of write protect if it is enabled. If the user needs the write protect status, sysfs can easily be checked after boot. As an additional positive consequence, this change will decrease the chattiness of scsi scan logging which has been shown to overwhelm systems when thousands of sd devices are attached.
Signed-off-by John Pittman <[email protected]>
Reviewed-by Laurence Oberman <[email protected]>
--- drivers/scsi/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/sd.c +2 -2
@@ -2702,8 +2702,8 @@ sd_read_write_protect_flag(struct scsi_disk *sdkp, unsigned char *buffer) sdkp->write_prot = ((data.device_specific &0x80 ) !=0 );set_disk_ro (sdkp->disk, sdkp->write_prot);if (sdkp->first_scan || old_wp != sdkp->write_prot) { -sd_printk (KERN_NOTICE , sdkp,"Write Protect is %s\n" , - sdkp->write_prot ?"on" :"off" ); +if (sdkp->write_prot) +sd_printk (KERN_NOTICE , sdkp,"Write Protect is on" );sd_printk (KERN_DEBUG , sdkp,"Mode Sense: %4ph\n" , buffer); } }
Signature · 1 line
2.17.2