Re: [PATCH] sd: skip non-removable devices in sd_check_events()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2019-01-16 at 08:35 +-0100, Hannes Reinecke wrote:
+AD4 If the device is +AF8-not+AF8 removable we should not start the event
+AD4 poller as the media will not go away. Having the event poller running
+AD4 will block the open() call as it will try to flush outstanding events,
+AD4 which it can't if the device is in state 'BLOCKED'. So the open() call
+AD4 will be stalled until the device state changed, which might be quite
+AD4 some time depending on the transport.
+AD4 
+AD4 Signed-off-by: Hannes Reinecke +ADw-hare+AEA-suse.com+AD4
+AD4 ---
+AD4  drivers/scsi/sd.c +AHw 3 +-+-+-
+AD4  1 file changed, 3 insertions(+-)
+AD4 
+AD4 diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
+AD4 index a1a44f52e0e8..521f0a384446 100644
+AD4 --- a/drivers/scsi/sd.c
+AD4 +-+-+- b/drivers/scsi/sd.c
+AD4 +AEAAQA -1539,6 +-1539,9 +AEAAQA static unsigned int sd+AF8-check+AF8-events(struct gendisk +ACo-disk, unsigned int clearing)
+AD4  		return 0+ADs
+AD4  
+AD4  	sdp +AD0 sdkp-+AD4-device+ADs
+AD4 +-	if (+ACE-sdp-+AD4-removable)
+AD4 +-		return 0+ADs
+AD4 +-
+AD4  	SCSI+AF8-LOG+AF8-HLQUEUE(3, sd+AF8-printk(KERN+AF8-INFO, sdkp, +ACI-sd+AF8-check+AF8-events+AFw-n+ACI))+ADs
+AD4  
+AD4  	/+ACo

Hi Hannes,

Although this patch looks fine to me, wouldn't it be a better approach to
cause the events checker not to submit any SCSI commands to blocked devices?
That approach should improve the sd behavior for both removable and
non-removable devices.

Thanks,

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux