diff mbox series

btrfs: send: return EOPNOTSUPP on unknown flags

Message ID 20240110165550.1701-1-dsterba@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs: send: return EOPNOTSUPP on unknown flags | expand

Commit Message

David Sterba Jan. 10, 2024, 4:55 p.m. UTC
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/
Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/send.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Filipe Manana Jan. 10, 2024, 5:10 p.m. UTC | #1
On Wed, Jan 10, 2024 at 4:56 PM David Sterba <dsterba@suse.com> wrote:
>
> 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/
> Signed-off-by: David Sterba <dsterba@suse.com>

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Looks good, thanks.

> ---
>  fs/btrfs/send.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
> index 2d7519a6ce72..7902298c1f25 100644
> --- a/fs/btrfs/send.c
> +++ b/fs/btrfs/send.c
> @@ -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
>
>
diff mbox series

Patch

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 2d7519a6ce72..7902298c1f25 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -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;
 	}