On Thu, Jan 27, 2022 at 12:01:43PM +0100, Jan Kara wrote: > On Wed 26-01-22 16:50:39, Christoph Hellwig wrote: > > ->release is only called after all outstanding I/O has completed, so only > > freeze the queue when clearing the backing file of a live loop device. > > > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > > Looks good. I was just wondering: Is there anything which prevents us from > moving blk_mq_freeze_queue() & blk_mq_unfreeze_queue() calls to > loop_clr_fd() around __loop_clr_fd() call? That would move more code into the freeze protection. Including lo_mutex which elsewhere is taken outside blk_freeze_queue. The lo_mutex acquisition is only for an assert, so we could skip that, so maybe we can get there. But the next patch adds another check for the release flag so it doesn't seem worth it at this moment.