summaryrefslogtreecommitdiff
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2023-04-06 13:00:34 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-17 11:35:55 +0200
commit5492d4081274dc2ac266d36814cb980abe6625f4 (patch)
tree7cb5a4afd37a906b7f6f5e4e6a18bede3ee3c468 /include/uapi/linux
parent946e067b4cdacda9af97bc175cb2d150062824a5 (diff)
downloadlinux-5492d4081274dc2ac266d36814cb980abe6625f4.tar.gz
linux-5492d4081274dc2ac266d36814cb980abe6625f4.tar.bz2
linux-5492d4081274dc2ac266d36814cb980abe6625f4.zip
btrfs: scrub: reject unsupported scrub flags
commit 604e6681e114d05a2e384c4d1e8ef81918037ef5 upstream. Since the introduction of scrub interface, the only flag that we support is BTRFS_SCRUB_READONLY. Thus there is no sanity checks, if there are some undefined flags passed in, we just ignore them. This is problematic if we want to introduce new scrub flags, as we have no way to determine if such flags are supported. Address the problem by introducing a check for the flags, and if unsupported flags are set, return -EOPNOTSUPP to inform the user space. This check should be backported for all supported kernels before any new scrub flags are introduced. CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/btrfs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index 3ee0678c0a83..72cd9f61f054 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -162,6 +162,7 @@ struct btrfs_scrub_progress {
};
#define BTRFS_SCRUB_READONLY 1
+#define BTRFS_SCRUB_SUPPORTED_FLAGS (BTRFS_SCRUB_READONLY)
struct btrfs_ioctl_scrub_args {
__u64 devid; /* in */
__u64 start; /* in */