[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210616171708.GA24636@dev-dsk-fllinden-2c-d7720709.us-west-2.amazon.com>
Date: Wed, 16 Jun 2021 17:17:08 +0000
From: Frank van der Linden <fllinden@...zon.com>
To: Trond Myklebust <trondmy@...merspace.com>
CC: "hsiangkao@...ux.alibaba.com" <hsiangkao@...ux.alibaba.com>,
"linux-nfs@...r.kernel.org" <linux-nfs@...r.kernel.org>,
"joseph.qi@...ux.alibaba.com" <joseph.qi@...ux.alibaba.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"anna.schumaker@...app.com" <anna.schumaker@...app.com>
Subject: Re: [PATCH] nfs: set block size according to pnfs_blksize first
On Wed, Jun 16, 2021 at 03:14:17PM +0000, Trond Myklebust wrote:
> The setxattr() manpage appears to suggest ERANGE is the correct return
> value here.
>
> ERANGE The size of name or value exceeds a filesystem-specific
> limit.
>
>
> However I can't tell if ext4 and xfs ever do that. Furthermore, it
> looks as if the VFS is always returning E2BIG if size > XATTR_SIZE_MAX.
>
The basic issue here is that there are two limits: the generic one
(XATTR_SIZE_MAX), and the fs-specific one.
When crossing the generic one, the xattr code returns E2BIG. When
crossing the fs-specific one, it looks like there are a few filesystems
that return E2BIG, but others (like ext4) return ENOSPC.
For the server, NFS4ERR_XATTR2BIG is the right value to return for all
these cases. For the generic limit, it's an easy check. For the
fs-specific limit, the server code doesn't necessarily know what's
going on, since filesystems don't have a way to advertise their
limits. So ENOSPC will *probably* mean that the attribute was too
large for the filesystem, but it might not.
You could change the server code to translate ENOSPC to NFS4ERR_XATTR2BIG.
But that might not be totally correct either, you're going to end up returning
an error to the client that is not correct in all cases either way.
The problem here for xfstests is how to define the 'correct' behavior
across all filesystems so that there's a clean pass/fail, as long
as these inconsistencies exist.
- Frank
Powered by blists - more mailing lists