NFSD: fix LISTXATTRS returning more bytes than maxcount
authorJorge Mora <jmora1300@gmail.com>
Thu, 25 Jan 2024 14:42:23 +0000 (07:42 -0700)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 1 Mar 2024 14:12:07 +0000 (09:12 -0500)
commit31e4bb8fb8d6f1e0049ba1e564ef920bf9b688d0
tree94d5feabf45b0a5cfedbe9c515f0a7b92c46468f
parent2f73f37d66774587a0d5053e365736e10fc98c41
NFSD: fix LISTXATTRS returning more bytes than maxcount

The maxcount is the maximum number of bytes for the LISTXATTRS4resok
result. This includes the cookie and the count for the name array,
thus subtract 12 bytes from the maxcount: 8 (cookie) + 4 (array count)
when filling up the name array.

Fixes: 23e50fe3a5e6 ("nfsd: implement the xattr functions and en/decode logic")
Signed-off-by: Jorge Mora <mora@netapp.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4xdr.c