Re: [PATCH v3] 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 Thu, 2019-03-21 at 13:43 +-0800, zhengbin wrote:
+AD4 diff --git a/drivers/scsi/scsi+AF8-sysfs.c b/drivers/scsi/scsi+AF8-sysfs.c
+AD4 index 6a9040f..342e513 100644
+AD4 --- a/drivers/scsi/scsi+AF8-sysfs.c
+AD4 +-+-+- b/drivers/scsi/scsi+AF8-sysfs.c
+AD4 +AEAAQA -771,9 +-771,20 +AEAAQA store+AF8-state+AF8-field(struct device +ACo-dev, struct device+AF8-attribute +ACo-attr,
+AD4 
+AD4         mutex+AF8-lock(+ACY-sdev-+AD4-state+AF8-mutex)+ADs
+AD4         ret +AD0 scsi+AF8-device+AF8-set+AF8-state(sdev, state)+ADs
+AD4 +-       /+ACo If device state changes to SDEV+AF8-RUNNING, we need to run hw queue
+AD4 +-        +ACo to avoid io hung.
+AD4 +-        +ACo-/
+AD4 +-       if ((ret +AD0APQ 0) +ACYAJg (state +AD0APQ SDEV+AF8-RUNNING))
+AD4 +-               goto out+AF8-run+AF8-hw+AF8-queue+ADs
+AD4         mutex+AF8-unlock(+ACY-sdev-+AD4-state+AF8-mutex)+ADs
+AD4 
+AD4         return ret +AD0APQ 0 ? count : -EINVAL+ADs
+AD4 +-
+AD4 +-out+AF8-run+AF8-hw+AF8-queue:
+AD4 +-       mutex+AF8-unlock(+ACY-sdev-+AD4-state+AF8-mutex)+ADs
+AD4 +-       blk+AF8-mq+AF8-run+AF8-hw+AF8-queues(sdev-+AD4-request+AF8-queue, true)+ADs
+AD4 +-
+AD4 +-       return count+ADs
+AD4  +AH0

Having two different code paths that call mutex+AF8-unlock() is unfortunate
because I don't think that is necessary to have two such paths, whether or
not blk+AF8-mq+AF8-run+AF8-hw+AF8-queues() is called with the state mutex held.

If you repost this patch, please remove the superfluous parentheses from
the if-condition.

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