Re: [PATCH v4] blk-mq: fix a hung issue when set device state to blocked and restore running

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

 



On 3/21/19 7:11 PM, Ming Lei wrote:
On Fri, Mar 22, 2019 at 09:45:54AM +0800, zhengbin wrote:
+	/* If device state changes to SDEV_RUNNING, we need to run hw queue
+	 * to avoid io hung.
+	 */
+	if (ret == 0 && state == SDEV_RUNNING)
+		blk_mq_run_hw_queues(sdev->request_queue, true);


Thinking of further, this way isn't safe, given the caller should make
sure that the queue is alive before calling blk_mq_run_hw_queues().

Now it is in sysfs write path, and the scsi device can become gone
just before calling blk_mq_run_hw_queues().

Hi Ming,

What makes you think that this approach is unsafe? I think that __scsi_remove_device() waits until all sysfs callbacks have finished before it calls blk_cleanup_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