Re: [PATCH v7 2/2] fuse: return -E2BIG for an oversized SETXATTR over io-uring

From: Joanne Koong

Date: Thu Sep 10 2026 - 14:05:03 EST


On Wed, Sep 9, 2026 at 7:25 PM Xiang Mei <xmei5@xxxxxxx> wrote:
>
> fuse_dev_do_read() answers a request that does not fit the server's
> buffer with -EIO, except for FUSE_SETXATTR, which gets -E2BIG since the
> value may legitimately be larger than the buffer and setxattr(2) reports
> that to userspace.
>
> Over io-uring the copy fails with -EIO for every opcode, so the two
> transports report different errnos for the same condition. Map that
> -EIO to -E2BIG for SETXATTR.
>
> Assisted-by: Claude:claude-opus-4-8
> Signed-off-by: Xiang Mei <xmei5@xxxxxxx>

Reviewed-by: Joanne Koong <joannelkoong@xxxxxxxxx>

> ---
> fs/fuse/dev_uring.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
> index c6dd420c4034..6351f2470e09 100644
> --- a/fs/fuse/dev_uring.c
> +++ b/fs/fuse/dev_uring.c
> @@ -893,6 +893,8 @@ static int fuse_uring_args_to_ring(struct fuse_req *req,
> fuse_copy_finish(&cs);
> if (err) {
> pr_info_ratelimited("%s fuse_copy_args failed\n", __func__);
> + if (err == -EIO && args->opcode == FUSE_SETXATTR)

nit: might be worth a comment above saying something like "fuse uring
doesn't use pipe buffers, so an -EIO err can only mean the in-args
didn't fit ent->payload"

Thanks,
Joanne

> + err = -E2BIG;
> return err;
> }
>
> --
> 2.43.0
>