On Wed, Jun 01, 2022 at 09:14:29AM +0200, Christoph Hellwig wrote: > On Wed, Jun 01, 2022 at 03:09:26PM +0800, Ming Lei wrote: > > > Yes, we probably need a blk_mq_quiesce_queue call like in the incremental > > > patch below. Do you have any good reproducer, though? > > > > blktests block/027 should cover this. > > That did not trigger the problem for me. This kind of issue is often not 100% duplicated. > > > > if (q->elevator) { > > > + blk_mq_quiesce_queue(q); > > > + > > > mutex_lock(&q->sysfs_lock); > > > elevator_exit(q); > > > mutex_unlock(&q->sysfs_lock); > > > + > > > + blk_mq_unquiesce_queue(q); > > > } > > > > > > > I am afraid the above way may slow down disk shutdown a lot, see > > the following commit, that is also the reason why I moved it into disk > > release handler, when any sync io submission are done. > > SCSI devices that are just probed and never had a disk attached will > not have q->elevator set and not hit this quiesce at all. Yes, but host with hundreds of real LUNs may be shutdown slowly too since sd_remove() won't be called in async way. Thanks, Ming