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:
> If the device is _not_ removable we should not start the event
> poller as the media will not go away. Having the event poller running
> will block the open() call as it will try to flush outstanding
> events,
> which it can't if the device is in state 'BLOCKED'. So the open()
> call
> will be stalled until the device state changed, which might be quite
> some time depending on the transport.
> 
> Signed-off-by: Hannes Reinecke <hare@xxxxxxxx>
> ---
>  drivers/scsi/sd.c | 3 +++
>  1 file changed, 3 insertions(+)

Thanks - you lost patience with me, did you? :-)

I didn't submit this yet because Tejun (adding him to CC) had
explicitly removed this check in commit 2bae0093cab4, and I was still
trying to understand why.

Perhaps a follow-up discussion will clarify that.

Martin

> 
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index a1a44f52e0e8..521f0a384446 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -1539,6 +1539,9 @@ static unsigned int sd_check_events(struct
> gendisk *disk, unsigned int clearing)
>  		return 0;
>  
>  	sdp = sdkp->device;
> +	if (!sdp->removable)
> +		return 0;
> +
>  	SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp,
> "sd_check_events\n"));
>  
>  	/*





[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