Skip to contentSkip to conversation

NFSv4.2: Add special handling for LISTXATTR receiving NFS4ERR_NOXATTR

PATCH New Anna Schumaker 1 participant 1 message Sep 21, 2022

Subsystems (2)
lore
Share & tools
lore

Anna Schumaker

author maintainer
#0 lore raw

PATCH 1/1 NFSv4.2: Add special handling for LISTXATTR receiving NFS4ERR_NOXATTR

From: Anna Schumaker <[email protected]>

We can translate this into an empty response list instead of passing an error up to userspace.

---
 fs/nfs/nfs42xdr.c | 8 ++++++++
 1 file changed, 8 insertions(+)
fs/nfs/nfs42xdr.c +8 -0
index b56f05113d36..fe1aeb0f048f 100644
@@ -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;
 	}
 
Signature · 1 line
2.37.3