From: Bart Van Assche <bvanassche@acm.org>
To: daan@amutable.com, Jens Axboe <axboe@kernel.dk>,
Christian Brauner <brauner@kernel.org>,
Josef Bacik <josef@toxicpanda.com>,
Daan De Meyer <daan.j.demeyer@gmail.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
nbd@other.debian.org, Christoph Hellwig <hch@infradead.org>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v3 2/2] nbd: drop stale partitions on NBD_CLEAR_SOCK
Date: Thu, 22 Oct 2026 09:11:21 -0700 [thread overview]
Message-ID: <301966cd-198b-4b67-af34-7f8fec19817c@acm.org> (raw)
In-Reply-To: <20261022-b4-loop-nbd-stale-partitions-v3-2-7c58ecab69c8@amutable.com>
On 10/22/26 6:31 AM, Daan De Meyer via B4 Relay wrote:
> + /*
> + * Drop the partitions of the disconnected device on the next open.
> + * They can exist even with max_part zero as they may have been added
> + * manually with BLKPG. Dropping them here is not possible as that
> + * needs open_mutex, which nbd_open() acquires under config_lock.
> + */
The lock order is reversed in this comment and also in the patch
description. The actual lock hierarchy is the reverse: bdev_open holds
disk->open_mutex when calling blkdev_get_whole -> nbd_open, so nbd_open
acquires config_lock under open_mutex (open_mutex -> nbd_index_mutex ->
config_lock), whereas nbd_clear_sock_ioctl is called with config_lock
held. The conclusion (cannot take open_mutex inside
nbd_clear_sock_ioctl) is still right.
Thanks,
Bart.
prev parent reply other threads:[~2026-10-22 16:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 13:31 [PATCH v3 0/2] loop, nbd: drop partitions left behind by the GD_NEED_PART_SCAN removal Daan De Meyer via B4 Relay
2026-10-22 13:31 ` [PATCH v3 1/2] loop: drop stale partitions on LOOP_CHANGE_FD Daan De Meyer via B4 Relay
2026-10-22 13:31 ` [PATCH v3 2/2] nbd: drop stale partitions on NBD_CLEAR_SOCK Daan De Meyer via B4 Relay
2026-10-22 16:11 ` Bart Van Assche [this message]
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=301966cd-198b-4b67-af34-7f8fec19817c@acm.org \
--to=bvanassche@acm.org \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=daan.j.demeyer@gmail.com \
--cc=daan@amutable.com \
--cc=hch@infradead.org \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nbd@other.debian.org \
--cc=shinichiro.kawasaki@wdc.com \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®