Skip to content

NFS sysfs scaffolding

Benjamin Coddington linux-nfs 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest11 patches 3 repliesIn review
  2. v3 RFC9 patches 0 repliesSuperseded
  3. v2 RFC9 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches0 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11NFS: rename nfs_client_kset to nfs_ksetfs/nfs/sysfs.c+8 -80 replies
2/11NFS: rename nfs_client_kobj to nfs_net_kobjfs/nfs/sysfs.c fs/nfs/sysfs.h+6 -60 replies
3/11NFS: Open-code the nfs_kset kset_create_and_add()fs/nfs/sysfs.c+32 -20 replies
4/11NFS: Make all of /sys/fs/nfs network-namespace uniquefs/nfs/sysfs.c fs/nfs/sysfs.h+33 -370 replies
5/11NFS: add superblock sysfs entriesfs/nfs/client.c fs/nfs/nfs4client.c fs/nfs/super.c +3 more+90 -13 replies
6/11NFS: Add sysfs links to sunrpc clients for nfs_clientsfs/nfs/client.c fs/nfs/nfs4client.c fs/nfs/sysfs.c +3 more+35 -80 replies
7/11NFS: add a sysfs link to the lockd rpc_clientfs/lockd/clntlock.c fs/nfs/client.c include/linux/lockd/bind.h+9 -00 replies
8/11NFS: add a sysfs link to the acl rpc_clientfs/nfs/nfs3client.c+4 -00 replies
9/11NFS: add sysfs shutdown knobfs/nfs/sysfs.c include/linux/nfs_fs_sb.h include/linux/sunrpc/clnt.h +1 more+61 -20 replies
10/11NFS: Cancel all existing RPC tasks when shutdownfs/nfs/sysfs.c+15 -40 replies
11/11NFSv4: Clean up some shutdown loopsfs/nfs/nfs4proc.c fs/nfs/nfs4state.c+4 -10 replies

Reviews trailers per patch

None of the 11 patches has a Reviewed-by or Acked-by.

PatchNathan Chancellor
1/11
2/11
3/11
4/11
5/11T-b
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/11] NFS sysfs scaffolding

Its been awhile, so here's a version 4 of the NFS sysfs scaffolding. This version is similar to v3, but is network namespace aware. Shutdown works well to clean up serverless clients, unless there are pNFS DS clients. A future version (in the works) will support shutdown for DS clients as well.

The client identifier path (unchanged here) is a little awkward - I don't think the "net" and "nfs_client" directories add anything useful, but they
were artifacts of working with the sysfs namespace API. I don't think we
can change it now without risking silent breakage. We get around needing extra directories here by open-coding kset_create_and_add() in patch 3.

I have Anna's optional server feature control namespaced and working well, but I've left it out for now because I'd like to split it into individual attribute files once I saw how easy it was to map the features into sysfs attributes. This seems to better fit the sysfs' style of one file-per-attribute. However, after getting things to work with namespaces I found that the sysfs macros to do this are not namespace aware, and much of the work would need either lots of open coding or our own set of macros to reduce redudant lines of code.

Changes since version 3:
https://lore.kernel.org/linux-nfs/[email protected]/

- /sys/fs/nfs/* objects are network-namespace unique

Benjamin Coddington (11):
NFS: rename nfs_client_kset to nfs_kset
NFS: rename nfs_client_kobj to nfs_net_kobj
NFS: Open-code the nfs_kset kset_create_and_add()
NFS: Make all of /sys/fs/nfs network-namespace unique
NFS: add superblock sysfs entries
NFS: Add sysfs links to sunrpc clients for nfs_clients
NFS: add a sysfs link to the lockd rpc_client
NFS: add a sysfs link to the acl rpc_client
NFS: add sysfs shutdown knob
NFS: Cancel all existing RPC tasks when shutdown
NFSv4: Clean up some shutdown loops

 fs/lockd/clntlock.c         |   6 +
 fs/nfs/client.c             |  22 ++++
 fs/nfs/nfs3client.c         |   4 +
 fs/nfs/nfs4client.c         |   4 +
 fs/nfs/nfs4proc.c           |   2 +-
 fs/nfs/nfs4state.c          |   3 +
 fs/nfs/super.c              |   6 +-
 fs/nfs/sysfs.c              | 235 ++++++++++++++++++++++++++++++------
 fs/nfs/sysfs.h              |  10 +-
 include/linux/lockd/bind.h  |   2 +
 include/linux/nfs_fs_sb.h   |   3 +
 include/linux/sunrpc/clnt.h |  11 +-
 net/sunrpc/clnt.c           |   5 +
 net/sunrpc/sysfs.h          |   7 --
 14 files changed, 274 insertions(+), 46 deletions(-)
Signature · 1 line
2.40.1