NFSv4.2: Add special handling for LISTXATTR receiving NFS4ERR_NOXATTR
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 21 Sep 2022 17:21:52 +0000 (13:21 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 5 Oct 2022 19:29:23 +0000 (15:29 -0400)
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>
fs/nfs/nfs42xdr.c

index b56f05113d367d6ecfb2f4827e0bac892f8a2193..fe1aeb0f048f2b73bf2fbc92d0771fefac1b1716 100644 (file)
@@ -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;
        }