Re: [PATCH] loop: Fix recently introduced lock inversion
Keith Busch <[email protected]>
| Newsgroups | org.kernel.vger.linux-block |
|---|---|
| Message-ID | <an3uafT_p6VOdP4V@kbusch-mbp> |
On Thu, Aug 13, 2026 at 04:14:20PM +0000, Bart Van Assche wrote:
> All block driver code except loop_set_dio() calls
> queue_limits_start_update() before it freezes the request queue. Make
> loop_set_dio() follow this convention. This patch fixes the following
> lockdep complaint:
>
> ======================================================
> WARNING: possible circular locking dependency detected
> 7.2.0-rc5-dbg #11 Not tainted
> ------------------------------------------------------
> losetup/2924 is trying to acquire lock:
> ffff88816c76da68 (&q->limits_lock){+.+.}-{4:4}, at: loop_set_dio+0x318/0x720 [loop]
>
> but task is already holding lock:
> ffff88816c76d430 (&q->q_usage_counter(io)#24){++++}-{0:0}, at: blk_mq_freeze_queue_nomemsave+0x1a/0x30
>
> which lock already depends on the new lock.
Thanks, looks good.
Reviewed-by: Keith Busch <[email protected]>