From: Christoph Hellwig <hch@infradead.org>
To: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>, Christoph Hellwig <hch@infradead.org>,
linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>
Subject: Re: loop change deprecation bdev->bd_holder_lock
Date: Tue, 24 Oct 2023 00:03:25 -0700 [thread overview]
Message-ID: <ZTdsPUgCA5TK1hfj@infradead.org> (raw)
In-Reply-To: <20231023-fungieren-erbschaft-0486c1eab011@brauner>
On Mon, Oct 23, 2023 at 05:35:25PM +0200, Christian Brauner wrote:
> I just realized that if we're able to deprecate LOOP_CHANGE_FD we remove
> one of the most problematic/weird cases for partitions and filesystems.
> change fd event on the first partition:
>
> sudo ./loop_change_fd /dev/loop0p1 img2
>
> we call disk_force_media_change() but that only works on disk->part0
> which means that we don't even cleanly shutdown the filesystem on the
> partition we're trying to mess around with.
Yes, disk_force_media_change has that general problem back from the
early Linux days (it had a different name back then, though). I think
it is because traditionally removable media in Linux never had
partitions, e.g. the CDROM drivers typically only allocated a single
minor number so they could not be scanned. But that has changed because
the interfaces got used for different use cases, and we also had
dynamic majors for a long time that now allow partitions. And there
are real use cases even for traditional removable media, e.g. MacOS
CDROMs traditionally did have partitions.
> For now, we should give up any pretense that disk_force_media_change()
> does anything useful for loop change fd and simply remove it completely.
> It's either useless, or it breaks the original semantics of loop change
> fd although I don't think anyone's ever used it the way I described
> above.
Maybe we can just drop the CHANGE_FD ioctl and see if anyone screams?
next prev parent reply other threads:[~2023-10-24 7:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 15:29 [PATCH] fs: Avoid grabbing sb->s_umount under bdev->bd_holder_lock Jan Kara
2023-10-18 15:46 ` Christoph Hellwig
2023-10-19 8:16 ` Christian Brauner
2023-10-19 8:33 ` Christian Brauner
2023-10-19 10:57 ` Jan Kara
2023-10-20 11:18 ` Christian Brauner
2023-10-19 13:40 ` Christoph Hellwig
2023-10-20 11:31 ` Christian Brauner
2023-10-20 12:04 ` Jan Kara
2023-10-23 7:40 ` Christian Brauner
2023-10-23 15:35 ` loop change deprecation bdev->bd_holder_lock Christian Brauner
2023-10-24 7:03 ` Christoph Hellwig [this message]
2023-10-24 8:44 ` loop change deprecation Christian Brauner
2023-10-23 14:08 ` LOOP_CONFIGURE uevents Christian Brauner
2023-10-24 7:06 ` Christoph Hellwig
2023-10-24 8:42 ` Christian Brauner
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=ZTdsPUgCA5TK1hfj@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.