summaryrefslogtreecommitdiff
path: root/fs/nfsd
diff options
context:
space:
mode:
authorFrank van der Linden <fllinden@amazon.com>2020-06-24 01:39:27 +0300
committerChuck Lever <chuck.lever@oracle.com>2020-07-14 00:27:03 +0300
commit0e885e846d96df0c8a4a829b1ad355a82ccda656 (patch)
tree08ac41074161275357704e8ba229345138ffcca6 /fs/nfsd
parent23e50fe3a5e6045a573c69d4b0e3d78aa6183323 (diff)
downloadlinux-0e885e846d96df0c8a4a829b1ad355a82ccda656.tar.xz
nfsd: add fattr support for user extended attributes
Check if user extended attributes are supported for an inode, and return the answer when being queried for file attributes. An exported filesystem can now signal its RFC8276 user extended attributes capability. Signed-off-by: Frank van der Linden <fllinden@amazon.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4xdr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 8bacc0ceae19..259d5ad0e3f4 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3213,6 +3213,15 @@ out_acl:
}
#endif
+ if (bmval2 & FATTR4_WORD2_XATTR_SUPPORT) {
+ p = xdr_reserve_space(xdr, 4);
+ if (!p)
+ goto out_resource;
+ err = xattr_supported_namespace(d_inode(dentry),
+ XATTR_USER_PREFIX);
+ *p++ = cpu_to_be32(err == 0);
+ }
+
attrlen = htonl(xdr->buf->len - attrlen_offset - 4);
write_bytes_to_xdr_buf(xdr->buf, attrlen_offset, &attrlen, 4);
status = nfs_ok;