From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
viro@zeniv.linux.org.uk, brauner@kernel.org
Subject: Re: [PATCH RFC 5/6] fs: introduce a shutdown_bdev super block operation
Date: Sun, 22 Jun 2025 22:15:19 -0700 [thread overview]
Message-ID: <aFji5yfAvEeuwvXF@infradead.org> (raw)
In-Reply-To: <wmvb4bnsz5bafoyu5mp33csjk4bcs63jemzi2cuqjzfy3rwogw@4t6fizv5ypna>
On Fri, Jun 20, 2025 at 05:36:52PM +0200, Jan Kara wrote:
> On Fri 20-06-25 15:17:28, Qu Wenruo wrote:
> > Currently we already have the super_operations::shutdown() callback,
> > which is called when the block device of a filesystem is marked dead.
> >
> > However this is mostly for single(ish) block device filesystems.
> >
> > For multi-device filesystems, they may afford a missing device, thus may
> > continue work without fully shutdown the filesystem.
> >
> > So add a new super_operation::shutdown_bdev() callback, for mutli-device
> > filesystems like btrfs and bcachefs.
> >
> > For now the only user is fs_holder_ops::mark_dead(), which will call
> > shutdown_bdev() if supported.
> > If not supported then fallback to the original shutdown() callback.
> >
> > Btrfs is going to add the usage of shutdown_bdev() soon.
> >
> > Signed-off-by: Qu Wenruo <wqu@suse.com>
>
> Thanks for the patch. I think that we could actually add 'bdev' that
> triggered shutdown among arguments ->shutdown takes instead of introducing
> a new handler.
I don't really think that's a good idea as-is. The current ->shutdown
callback is called ->shutdown because it is expected to shut the file
system down. That's why I suggested to Qu to add a new devloss callback,
to describe that a device is lost. In a file system with built-in
redundancy that is not a shutdown. So Qu, please add a devloss
callback. And maybe if we have no other good use for the shutdown
callback we can remove it in favor of the devloss one. But having
something named shutdown take the block device and not always shutting
the file system down is highly confusing.
next prev parent reply other threads:[~2025-06-23 5:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-20 5:47 [PATCH RFC 0/6] btrfs: go fs_holder_ops and add shutdown_bdev() callback Qu Wenruo
2025-06-20 5:47 ` [PATCH RFC 1/6] btrfs: introduce a new fs state, EMERGENCY_SHUTDOWN Qu Wenruo
2025-06-20 5:47 ` [PATCH RFC 2/6] btrfs: reject file operations if in shutdown state Qu Wenruo
2025-06-20 5:47 ` [PATCH RFC 3/6] btrfs: reject delalloc ranges if the fs is shutdown Qu Wenruo
2025-06-20 5:47 ` [PATCH RFC 4/6] btrfs: implement shutdown ioctl Qu Wenruo
2025-06-20 5:47 ` [PATCH RFC 5/6] fs: introduce a shutdown_bdev super block operation Qu Wenruo
2025-06-20 15:36 ` Jan Kara
2025-06-20 22:10 ` Qu Wenruo
2025-06-23 5:15 ` Christoph Hellwig [this message]
2025-06-23 5:34 ` Qu Wenruo
2025-06-23 10:57 ` Jan Kara
2025-06-23 10:56 ` Christian Brauner
2025-06-23 13:57 ` Christoph Hellwig
2025-06-23 21:27 ` Qu Wenruo
2025-06-24 8:51 ` Christian Brauner
2025-06-24 9:06 ` Qu Wenruo
2025-06-24 9:13 ` Christian Brauner
2025-06-24 9:51 ` Qu Wenruo
2025-06-24 10:15 ` Christian Brauner
2025-06-24 21:06 ` Qu Wenruo
2025-06-24 12:34 ` Christoph Hellwig
2025-06-24 12:33 ` Christoph Hellwig
2025-06-24 12:30 ` Christoph Hellwig
2025-06-20 5:47 ` [PATCH RFC 6/6] btrfs: implement shutdown_bdev super operation callback Qu Wenruo
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=aFji5yfAvEeuwvXF@infradead.org \
--to=hch@infradead.org \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=wqu@suse.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;
as well as URLs for NNTP newsgroup(s).