diff options
author | Qu Wenruo <wqu@suse.com> | 2024-01-10 01:28:26 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2024-01-12 04:04:19 +0300 |
commit | 173431b274a9a54fc10b273b46e67f46bcf62d2e (patch) | |
tree | 8d7927d102469a50d9f468ac2a31da8a3b2a1529 /include/uapi/linux/btrfs.h | |
parent | 3324d0547861b16cf436d54abba7052e0c8aa9de (diff) | |
download | linux-173431b274a9a54fc10b273b46e67f46bcf62d2e.tar.xz |
btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args
Add extra sanity check for btrfs_ioctl_defrag_range_args::flags.
This is not really to enhance fuzzing tests, but as a preparation for
future expansion on btrfs_ioctl_defrag_range_args.
In the future we're going to add new members, allowing more fine tuning
for btrfs defrag. Without the -ENONOTSUPP error, there would be no way
to detect if the kernel supports those new defrag features.
CC: stable@vger.kernel.org # 4.14+
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'include/uapi/linux/btrfs.h')
-rw-r--r-- | include/uapi/linux/btrfs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h index 7c29d82db9ee..f8bc34a6bcfa 100644 --- a/include/uapi/linux/btrfs.h +++ b/include/uapi/linux/btrfs.h @@ -614,6 +614,9 @@ struct btrfs_ioctl_clone_range_args { */ #define BTRFS_DEFRAG_RANGE_COMPRESS 1 #define BTRFS_DEFRAG_RANGE_START_IO 2 +#define BTRFS_DEFRAG_RANGE_FLAGS_SUPP (BTRFS_DEFRAG_RANGE_COMPRESS | \ + BTRFS_DEFRAG_RANGE_START_IO) + struct btrfs_ioctl_defrag_range_args { /* start of the defrag operation */ __u64 start; |