Re: [PATCH] block: don't protect submit_bio_checks by q_usage_counter

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

 



On Mon, Jan 10, 2022 at 05:49:09PM +0100, Christoph Hellwig wrote:
> On Tue, Jan 04, 2022 at 09:42:23PM +0800, Ming Lei wrote:
> > Commit cc9c884dd7f4 ("block: call submit_bio_checks under q_usage_counter")
> > uses q_usage_counter to protect submit_bio_checks for avoiding IO after
> > disk is deleted by del_gendisk().
> > 
> > Turns out the protection isn't necessary, because once
> > blk_mq_freeze_queue_wait() in del_gendisk() returns:
> > 
> > 1) all in-flight IO has been done
> 
> Only for blk-mq drivers.

Yes, but the q_usage_counter protection for bio based queue is just for
calling ->submit_bio(), which is added in:

3ef28e83ab15 block: generic request_queue reference counting

Also we never support to drain in-flight IO for bio based queue, and
this patch doesn't make a difference on this area.

> 
> So I don't think this is actually safe.

Draining bio based queue is always driver's responsibility, block
layer never supports that.


Thanks,
Ming




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux