From: Josef Bacik Date: Wed, 15 Dec 2021 20:40:02 +0000 (-0500) Subject: btrfs: disable scrub for extent-tree-v2 X-Git-Tag: baikal/aarch64/sdk6.1~4442^2~69 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=f20ff47689fef674f807c390aa9c121afa2f4f2b;p=kernel.git btrfs: disable scrub for extent-tree-v2 Scrub depends on extent references for every block, and with extent tree v2 we won't have that, so disable scrub until we can add back the proper code to handle extent-tree-v2. Signed-off-by: Josef Bacik Signed-off-by: David Sterba --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 7a59887a2b544..ecf3e05104aaa 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3979,6 +3979,11 @@ static long btrfs_ioctl_scrub(struct file *file, void __user *arg) if (!capable(CAP_SYS_ADMIN)) return -EPERM; + if (btrfs_fs_incompat(fs_info, EXTENT_TREE_V2)) { + btrfs_err(fs_info, "scrub is not supported on extent tree v2 yet"); + return -EINVAL; + } + sa = memdup_user(arg, sizeof(*sa)); if (IS_ERR(sa)) return PTR_ERR(sa);