]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: implement shutdown ioctl
authorQu Wenruo <wqu@suse.com>
Sun, 12 Oct 2025 23:52:04 +0000 (10:22 +1030)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 20:56:17 +0000 (21:56 +0100)
commit6b1ac78dd0f29fe66421c460c12ec15e45af38c3
treed8ae7f41c13847b79788ec6570795f083af066c6
parent9b2839451dfc1eccd48972c675bb0e8e9d050d56
btrfs: implement shutdown ioctl

The shutdown ioctl should follow the XFS one, which use magic number 'X',
and ioctl number 125, with a uint32 as flags.

For now btrfs don't distinguish DEFAULT and LOGFLUSH flags (just like
f2fs), both will freeze the fs first (implies committing the current
transaction), setting the SHUTDOWN flag and finally thaw the fs.

For NOLOGFLUSH flag, the freeze/thaw part is skipped thus the current
transaction is aborted.

The new shutdown ioctl is hidden behind experimental features for more
testing.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Anand Jain <asj@kernel.org>
Tested-by: Anand Jain <asj@kernel.org>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c
include/uapi/linux/btrfs.h