Re: [PATCH v3 3/4] sd: Make synchronize cache upon shutdown asynchronous

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

 



On Thu, 2017-04-20 at 15:13 -0700, James Bottomley wrote:
> How is that possible?  Once the device goes into the CANCEL state, it
> no longer can be found by starget_for_each_device() because
> scsi_device_get() returns NULL ...

scsi_target_block() is not serialized against __scsi_remove_device(). I think
the following sequence of events can cause a queue to be stopped for a device
in the CANCEL state:
(a) scsi_target_block() triggers a call to scsi_get_device().
(b) __scsi_remove_device() is called from the context of another thread.
(c) __scsi_remove_device() changes the device state into SDEV_CANCEL.
(d) scsi_internal_device_block() calls blk_mq_stop_hw_queue().

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