summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2024-01-10 08:58:26 +1030
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-31 16:17:07 -0800
commit52e02f26d01a61d598bb5b9ce3d336562b4e0b5a (patch)
tree3cdf434b4e1fb46829e3ee6202e5eb48a0e45c97 /include/uapi
parent86aff7c5f7c6722041545825162dcf1b30bbeff2 (diff)
btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args
commit 173431b274a9a54fc10b273b46e67f46bcf62d2e upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/btrfs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index d4d4fa0bb362..24b54635bae9 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -585,6 +585,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;