This series is relying on another series here: https://lore.kernel.org/linux-btrfs/cover.1750137547.git.wqu@xxxxxxxx/ That above series prepare btrfs to use fs_holder_ops, and the first patch in this series is exactly making btrfs use that fs_holder_ops. Then patch 2~4 implements the shutdown ioctl for btrfs. For now the shutdown ioctl has no proper sync yet. Patch 5 is the one affecting the generic fs_holder_ops and super_operations, that we need a shutdown_bdev() variant, which passes the bdev to the fs and let the fs to determine if they can continue operation or needs to shutdown. AKA, the shutdown_bdev() variant is for multi-devices filesystems like btrfs and bcachefs. And finally implement the shutdown_bdev() for btrfs, so that eventually generic/730 can properly pass. Reason for RFC: There are still test failures for shutdown group, mostly due to the fact that btrfs is not implementing the proper flags handling (e.g. currently the shutdown never sync the fs no matter what). But I want to get some feedback about the new super_operations::shutdown_bdev() call back before committing too much. Qu Wenruo (6): btrfs: introduce a new fs state, EMERGENCY_SHUTDOWN btrfs: reject file operations if in shutdown state btrfs: reject delalloc ranges if the fs is shutdown btrfs: implement shutdown ioctl fs: introduce a shutdown_bdev super block operation btrfs: implement shutdown_bdev super operation callback fs/btrfs/file.c | 25 ++++++++++++++++++++++++- fs/btrfs/fs.h | 18 ++++++++++++++++++ fs/btrfs/inode.c | 14 +++++++++++++- fs/btrfs/ioctl.c | 21 +++++++++++++++++++++ fs/btrfs/messages.c | 1 + fs/btrfs/reflink.c | 3 +++ fs/btrfs/super.c | 34 ++++++++++++++++++++++++++++++++++ fs/btrfs/volumes.c | 2 ++ fs/btrfs/volumes.h | 5 +++++ fs/super.c | 4 +++- include/linux/fs.h | 10 ++++++++++ include/uapi/linux/btrfs.h | 9 +++++++++ 12 files changed, 143 insertions(+), 3 deletions(-) -- 2.49.0