From: Nilay Shroff <nilay@linux.ibm.com>
To: Ming Lei <ming.lei@redhat.com>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org
Cc: syzbot+2bcecf3c38cb3e8fdc8d@syzkaller.appspotmail.com,
Yu Kuai <yukuai3@huawei.com>
Subject: Re: [PATCH] nbd: fix lockdep deadlock warning
Date: Wed, 9 Jul 2025 13:29:07 +0530 [thread overview]
Message-ID: <95e6bce2-19dc-4085-908e-c81fa7a1d5d3@linux.ibm.com> (raw)
In-Reply-To: <20250709014109.2292837-1-ming.lei@redhat.com>
On 7/9/25 7:11 AM, Ming Lei wrote:
> diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
> index 7bdc7eb808ea..136640e4c866 100644
> --- a/drivers/block/nbd.c
> +++ b/drivers/block/nbd.c
> @@ -1473,7 +1473,15 @@ static int nbd_start_device(struct nbd_device *nbd)
> return -EINVAL;
> }
>
> - blk_mq_update_nr_hw_queues(&nbd->tag_set, config->num_connections);
> +retry:
> + mutex_unlock(&nbd->config_lock);
> + blk_mq_update_nr_hw_queues(&nbd->tag_set, num_connections);
> + mutex_lock(&nbd->config_lock);
> +
> + /* if another code path updated nr_hw_queues, retry until succeed */
> + if (num_connections != config->num_connections)
> + goto retry;
> +
Don't we need to update num_connections to config->num_connections
here before we attempt retry?
Thanks,
--Nilay
next prev parent reply other threads:[~2025-07-09 7:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 1:41 [PATCH] nbd: fix lockdep deadlock warning Ming Lei
2025-07-09 6:46 ` 余快
2025-07-09 7:59 ` Nilay Shroff [this message]
2025-07-09 8:10 ` Ming Lei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=95e6bce2-19dc-4085-908e-c81fa7a1d5d3@linux.ibm.com \
--to=nilay@linux.ibm.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=syzbot+2bcecf3c38cb3e8fdc8d@syzkaller.appspotmail.com \
--cc=yukuai3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox