Re: [PATCH 01/13] nbd: use the correct block_device in nbd_ioctl
- To: Jan Kara <jack@suse.cz>
- Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>, Josef Bacik <josef@toxicpanda.com>, Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>, Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>, "Darrick J . Wong" <djwong@kernel.org>, Ming Lei <ming.lei@redhat.com>, linux-block@vger.kernel.org, nbd@other.debian.org
- Subject: Re: [PATCH 01/13] nbd: use the correct block_device in nbd_ioctl
- From: Christoph Hellwig <hch@lst.de>
- Date: Thu, 24 Mar 2022 18:11:48 +0100
- Message-id: <[🔎] 20220324171148.GA28007@lst.de>
- In-reply-to: <[🔎] 20220324132322.2t3y4evcxunlpvzm@quack3.lan>
- References: <[🔎] 20220324075119.1556334-1-hch@lst.de> <[🔎] 20220324075119.1556334-2-hch@lst.de> <[🔎] 20220324122041.itc55zladc5sax5p@quack3.lan> <[🔎] 20220324132322.2t3y4evcxunlpvzm@quack3.lan>
On Thu, Mar 24, 2022 at 02:23:22PM +0100, Jan Kara wrote:
> Should't we call __invalidate_device() for the partition bdev here? Because
> if the NBD device has partitions, filesystem will be mounted on this
> partition and we want to invalidate it. Similarly the partition buffer
> cache is different from the buffer cache of the whole device and we should
> invalidate the partition one. In fact in cases like this I think we need
> to invalidate all the partitions and filesystems that are there on this
> disk so neither the old, nor the new code looks quite correct to me. Am I
> missing something?
Well, that assumes just one partition is used, which kinda defeats the
purpose of partitions. I can exclude the __invalidate_device to not
change from one kind of broken to another, but I suspect the real
question is why we have this __invalidate_device call at all.
Reply to: