From: Anna Schumaker Date: Wed, 21 Sep 2022 17:21:52 +0000 (-0400) Subject: NFSv4.2: Add special handling for LISTXATTR receiving NFS4ERR_NOXATTR X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=963694615d9d5a860e6571da18e50f14ab3583b3;p=linux.git NFSv4.2: Add special handling for LISTXATTR receiving NFS4ERR_NOXATTR We can translate this into an empty response list instead of passing an error up to userspace. Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index b56f05113d367..fe1aeb0f048f2 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c @@ -569,6 +569,14 @@ static int decode_listxattrs(struct xdr_stream *xdr, */ if (status == -ETOOSMALL) status = -ERANGE; + /* + * Special case: for LISTXATTRS, NFS4ERR_NOXATTR + * should be translated to success with zero-length reply. + */ + if (status == -ENODATA) { + res->eof = true; + status = 0; + } goto out; }