On Wed, 2017-09-27 at 06:23 +0800, Ming Lei wrote:
>         mutex_lock(&sdev->state_mutex);
>         err = scsi_device_set_state(sdev, SDEV_QUIESCE);
>         if (err == 0)
>                 blk_set_preempt_only(q, true);
>         mutex_unlock(&sdev->state_mutex);
> 
>         if (err)
>                 return err;
> 
>         blk_mq_freeze_queue(q);
>         blk_mq_unfreeze_queue(q);
> 
> Any requests allocated before scsi_device_set_state() and
> dispatched after scsi_device_set_state() can't be drained up
> any more, then blk_mq_freeze_queue() will wait forever for the
> drain up, so not only this patchset can't fix the current quiesce
> issue, but also introduces new I/O hang in scsi_device_quiesce().

That's a good catch, but fortunately this is very easy to fix: move the
blk_mq_freeze_queue() call before the mutex_lock() and scsi_device_set_state()
calls. The error path will also need some adjustment.

Bart.

Reply via email to