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@xxxxxxxx> > > 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.