Skip to content

Commit 0e885e8

Browse files
fllindenchucklever
authored andcommitted
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 <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 23e50fe commit 0e885e8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3213,6 +3213,15 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,
32133213
}
32143214
#endif
32153215

3216+
if (bmval2 & FATTR4_WORD2_XATTR_SUPPORT) {
3217+
p = xdr_reserve_space(xdr, 4);
3218+
if (!p)
3219+
goto out_resource;
3220+
err = xattr_supported_namespace(d_inode(dentry),
3221+
XATTR_USER_PREFIX);
3222+
*p++ = cpu_to_be32(err == 0);
3223+
}
3224+
32163225
attrlen = htonl(xdr->buf->len - attrlen_offset - 4);
32173226
write_bytes_to_xdr_buf(xdr->buf, attrlen_offset, &attrlen, 4);
32183227
status = nfs_ok;

0 commit comments

Comments
 (0)