btrfs: send: return EOPNOTSUPP on unknown flags
David Sterba
maintainerPATCH 1/1 btrfs: send: return EOPNOTSUPP on unknown flags
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.
Link https://lore.kernel.org/linux-btrfs/CAL3q7H5rryOLzp3EKq8RTbjMHMHeaJubfpsVLF6H4qJnKCUR1w@mail.gmail.com/ open here
Signed-off-by David Sterba <[email protected]>
--- fs/btrfs/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/send.c +1 -1
@@ -8111,7 +8111,7 @@ long btrfs_ioctl_send(struct inode *inode, struct btrfs_ioctl_send_args *arg) }if (arg->flags & ~BTRFS_SEND_FLAG_MASK ) { - ret = -EINVAL ; + ret = -EOPNOTSUPP ; goto out; }
Signature · 1 line
2.42.1
Quoted 9 lines · David Sterba
When some ioctl flags are checked we return EOPNOTSUPP, like for
BTRFS_SCRUB_SUPPORTED_FLAGS,BTRFS_SUBVOL_CREATE_ARGS_MASKor 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.
Reviewed-by Filipe Manana <[email protected]>
Looks good, thanks.
Quoted 21 lines
--- fs/btrfs/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/btrfs/send.c +1
-2@@ -8111,7 +8111,7 @@ long btrfs_ioctl_send(struct inode *inode, struct btrfs_ioctl_send_args *arg) }if (arg->flags & ~BTRFS_SEND_FLAG_MASK ) { - ret = -EINVAL ; + ret = -EOPNOTSUPP ; goto out; } --2.42.1