This is a note to let you know that I've just added the patch titled btrfs: send: return EOPNOTSUPP on unknown flags to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: btrfs-send-return-eopnotsupp-on-unknown-flags.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From f884a9f9e59206a2d41f265e7e403f080d10b493 Mon Sep 17 00:00:00 2001 From: David Sterba <dsterba@xxxxxxxx> Date: Wed, 10 Jan 2024 17:48:44 +0100 Subject: btrfs: send: return EOPNOTSUPP on unknown flags From: David Sterba <dsterba@xxxxxxxx> commit f884a9f9e59206a2d41f265e7e403f080d10b493 upstream. When some ioctl flags are checked we return EOPNOTSUPP, like for BTRFS_SCRUB_SUPPORTED_FLAGS, BTRFS_SUBVOL_CREATE_ARGS_MASK or fallocate modes. The EINVAL is supposed to be for a supported but invalid values or combination of options. Fix that when checking send flags so it's consistent with the rest. CC: stable@xxxxxxxxxxxxxxx # 4.14+ Link: https://lore.kernel.org/linux-btrfs/CAL3q7H5rryOLzp3EKq8RTbjMHMHeaJubfpsVLF6H4qJnKCUR1w@xxxxxxxxxxxxxx/ Reviewed-by: Filipe Manana <fdmanana@xxxxxxxx> Signed-off-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/btrfs/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -7363,7 +7363,7 @@ long btrfs_ioctl_send(struct file *mnt_f } if (arg->flags & ~BTRFS_SEND_FLAG_MASK) { - ret = -EINVAL; + ret = -EOPNOTSUPP; goto out; } Patches currently in stable-queue which might be from dsterba@xxxxxxxx are queue-5.4/btrfs-defrag-reject-unknown-flags-of-btrfs_ioctl_defrag_range_args.patch queue-5.4/btrfs-ref-verify-free-ref-cache-before-clearing-mount-opt.patch queue-5.4/btrfs-forbid-creating-subvol-qgroups.patch queue-5.4/btrfs-send-return-eopnotsupp-on-unknown-flags.patch queue-5.4/btrfs-forbid-deleting-live-subvol-qgroup.patch queue-5.4/btrfs-tree-checker-fix-inline-ref-size-in-error-messages.patch queue-5.4/btrfs-don-t-warn-if-discard-range-is-not-aligned-to-sector.patch