Skip to content

client side user xattr (RFC8276) support

Frank van der Linden fstests linux-nfs 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest13 patches 7 repliesIn review
  2. v213 patches 9 repliesSuperseded
  3. v114 patches 20 repliesSuperseded

Changes in v3 from the cover letter

* Rebase to v5.8-rc2

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13nfs,nfsd: NFSv4.2 extended attribute protocol definitionsinclude/linux/nfs4.h include/uapi/linux/nfs4.h+23 -00 replies
2/13nfs: add client side only definitions for user xattrsinclude/linux/nfs4.h include/linux/nfs_fs.h+8 -00 replies
3/13NFSv4.2: define limits and sizes for user xattr handlingfs/nfs/client.c fs/nfs/nfs42.h fs/nfs/nfs42xdr.c +3 more+149 -20 replies
4/13NFSv4.2: query the server for extended attribute supportfs/nfs/client.c fs/nfs/nfs4proc.c fs/nfs/nfs4xdr.c +2 more+32 -10 replies
5/13NFSv4.2: add client side XDR handling for extended attributesfs/nfs/nfs42xdr.c fs/nfs/nfs4xdr.c include/linux/nfs_xdr.h+430 -30 replies
6/13nfs: define nfs_access_get_cached functionfs/nfs/dir.c include/linux/nfs_fs.h+18 -40 replies
7/13NFSv4.2: query the extended attribute access bitsfs/nfs/dir.c fs/nfs/nfs4proc.c+10 -00 replies
8/13nfs: modify update_changeattr to deal with regular filesfs/nfs/nfs4_fs.h fs/nfs/nfs4proc.c+49 -260 replies
9/13nfs: define and use the NFS_INO_INVALID_XATTR flagfs/nfs/inode.c fs/nfs/nfs4proc.c fs/nfs/nfstrace.h +1 more+11 -30 replies
10/13nfs: make the buf_to_pages_noslab function available to the nfs codefs/nfs/nfs4_fs.h fs/nfs/nfs4proc.c+4 -20 replies
11/13NFSv4.2: add the extended attribute proc functions.fs/nfs/nfs42.h fs/nfs/nfs42proc.c+244 -00 replies
12/13NFSv4.2: hook in the user extended attribute handlersfs/nfs/nfs4proc.c+121 -26 replies
13/13NFSv4.2: add client side xattr caching.fs/nfs/Makefile fs/nfs/inode.c fs/nfs/nfs42proc.c +6 more+1179 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 00/13] client side user xattr (RFC8276) support

v3:
* Rebase to v5.8-rc2

v2:
* Move nfs4 specific definitions to nfs_fs4.h
* Squash some patches together to avoid unused function warnings when bisecting.
* Made determining server support a two-step process. First, the extended attribute FATTR is verified to be supported, then the value of the attributed is queried in fsinfo to determine support.
* Fixed up Makefile to remove an unneeded extra line.

v1:
* Client side caching is now included in this patch set.
* As per the discussion, user extended attributes are enabled if the client and server support them (e.g. they support 4.2 and advertise the user extended attribute FATTR). There are no longer options to switch them off on either the client or the server.
* The code is no longer conditioned on a config option.
* The number of patches has been reduced somewhat by merging smaller, related ones.

Original combined client/server RFC:
https://patchwork.kernel.org/cover/11143565/

In general, these patches were, both server and client, tested as follows:
* stress-ng-xattr with 1000 workers
* Test all corner cases (XATTR_SIZE_*)
* Test all failure cases (no xattr, setxattr with different or invalid flags, etc).
* Verify the content of xattrs across several operations.
* Use KASAN and KMEMLEAK for a longer mix of testruns to verify that there were no leaks (after unmounting the filesystem).
* Interop run against FreeBSD server/client implementation.
* Ran xfstests-dev, with no unexpected/new failures as compared to an unpatched kernel. To fully use xfstests-dev, it needed some modifications, as it expects to either use all xattr namespaces, or none. Whereas NFS only suppors the "user." namespace (+ optional ACLs). I will send the changes in seperately.
* Test the memory shrinker for the client side cache by running the client inside a 1G KVM VM, filling up the cache by running an agressive multi-threaded xattr workload, and tracing the shrinker when it kicked in. No memory allocation problems were seen.

Frank van der Linden (13):
nfs,nfsd: NFSv4.2 extended attribute protocol definitions
nfs: add client side only definitions for user xattrs NFSv4.2: define limits and sizes for user xattr handling NFSv4.2: query the server for extended attribute support NFSv4.2: add client side XDR handling for extended attributes
nfs: define nfs_access_get_cached function
NFSv4.2: query the extended attribute access bits
nfs: modify update_changeattr to deal with regular files
nfs: define and use the NFS_INO_INVALID_XATTR flag
nfs: make the buf_to_pages_noslab function available to the nfs code NFSv4.2: add the extended attribute proc functions. NFSv4.2: hook in the user extended attribute handlers NFSv4.2: add client side xattr caching.

 fs/nfs/Makefile             |    2 +-
 fs/nfs/client.c             |   22 +-
 fs/nfs/dir.c                |   24 +-
 fs/nfs/inode.c              |   16 +-
 fs/nfs/nfs42.h              |   24 +
 fs/nfs/nfs42proc.c          |  248 ++++++++
 fs/nfs/nfs42xattr.c         | 1083 +++++++++++++++++++++++++++++++++++
 fs/nfs/nfs42xdr.c           |  438 ++++++++++++++
 fs/nfs/nfs4_fs.h            |   35 ++
 fs/nfs/nfs4client.c         |   31 +
 fs/nfs/nfs4proc.c           |  237 +++++++-
 fs/nfs/nfs4super.c          |   10 +
 fs/nfs/nfs4xdr.c            |   31 +
 fs/nfs/nfstrace.h           |    3 +-
 include/linux/nfs4.h        |   25 +
 include/linux/nfs_fs.h      |   12 +
 include/linux/nfs_fs_sb.h   |    6 +
 include/linux/nfs_xdr.h     |   60 +-
 include/uapi/linux/nfs4.h   |    3 +
 include/uapi/linux/nfs_fs.h |    1 +
 20 files changed, 2269 insertions(+), 42 deletions(-)
 create mode 100644 fs/nfs/nfs42xattr.c
Signature · 1 line
2.17.2