summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAnna Schumaker <Anna.Schumaker@Netapp.com>2022-09-21 19:21:52 +0200
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2022-10-05 21:29:23 +0200
commit963694615d9d5a860e6571da18e50f14ab3583b3 (patch)
treedf91c1b40eb9eac6e1bbd0ebc0fdcb529366cd01 /fs
parentnfs: remove nfs_wait_atomic_killable() and nfs_write_prepare() declaration (diff)
downloadlinux-963694615d9d5a860e6571da18e50f14ab3583b3.tar.xz
linux-963694615d9d5a860e6571da18e50f14ab3583b3.zip
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 <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs42xdr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c
index b56f05113d36..fe1aeb0f048f 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;
}