Skip to content

RFC NFSd state containerization

Stanislav Kinsbursky linux-nfs lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest15 patches 5 repliesIn review
  2. v1 RFC15 patches 4 repliesSuperseded

Changes in v2 from the cover letter

1) Rebased on current nfsd-next.
2) Legacy tracker init become clearer.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15nfsd: use service net instead of hard-coded net where possiblefs/nfsd/nfs4state.c+5 -50 replies
2/15nfsd: make nfs4_client network namespace dependentfs/nfsd/nfs4callback.c fs/nfsd/nfs4recover.c fs/nfsd/nfs4state.c +1 more+14 -130 replies
3/15nfsd: make reclaim_str_hashtbl allocated per netfs/nfsd/netns.h fs/nfsd/nfs4recover.c fs/nfsd/nfs4state.c +1 more+111 -550 replies
4/15nfsd: make conf_id_hashtbl allocated per netfs/nfsd/netns.h fs/nfsd/nfs4state.c+55 -210 replies
5/15nfsd: make conf_name_tree per netfs/nfsd/netns.h fs/nfsd/nfs4state.c+20 -150 replies
6/15nfsd: make unconf_id_hashtbl allocated per netfs/nfsd/netns.h fs/nfsd/nfs4state.c+16 -100 replies
7/15nfsd: make unconf_name_tree per netfs/nfsd/netns.h fs/nfsd/nfs4state.c+23 -230 replies
8/15nfsd: make ownerstr_hashtbl allocated per netfs/nfsd/netns.h fs/nfsd/nfs4state.c+27 -150 replies
9/15nfsd: make lockowner_ino_hashtbl allocated per netfs/nfsd/netns.h fs/nfsd/nfs4state.c+20 -110 replies
10/15nfsd: make sessionid_hashtbl allocated per netfs/nfsd/netns.h fs/nfsd/nfs4state.c+20 -110 replies
11/15nfsd: make client_lru list per netfs/nfsd/netns.h fs/nfsd/nfs4state.c+13 -80 replies
12/15nfsd: make close_lru list per netfs/nfsd/netns.h fs/nfsd/nfs4state.c+13 -130 replies
13/15nfsd: use service net instead of hard-coded init_netfs/nfsd/nfs4proc.c fs/nfsd/nfs4state.c fs/nfsd/state.h +1 more+49 -310 replies
14/15nfsd: pass nfsd_net instead of net to grace endersfs/nfsd/nfs4recover.c fs/nfsd/nfs4state.c fs/nfsd/state.h+10 -140 replies
15/15nfsd: make laundromat network namespace awarefs/nfsd/netns.h fs/nfsd/nfs4state.c+15 -80 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [RFC PATCH v2 00/15] NFSd state containerization

This patch set is my first attempt to containerize NFSv4 state - i.e. make it works in networks namespace context.
I admit, that some of this new code could be partially rewritten during future NFSd containerization.
But the overall idea look more or less correct to me.
So, the main things here are:
1) making nfs4_client network namespace aware.
2) Allocating all hashes (except file_hashtbl and reclaim_str_hashtbl) per network namespace context on NFSd start (not init) and destroying on NFSd state shutdown.
3) Allocating of reclaim_str_hashtbl on legacy tracker start and destroying on legacy tracker stop.
4) Moving of client_lru and close_lru lists to per-net data.
5) Making lundromat network namespace aware.

v2:
1) Rebased on current nfsd-next.
2) Legacy tracker init become clearer.

The following series implements...

---

Stanislav Kinsbursky (15):
nfsd: use service net instead of hard-coded net where possible
nfsd: make nfs4_client network namespace dependent
nfsd: make reclaim_str_hashtbl allocated per net
nfsd: make conf_id_hashtbl allocated per net
nfsd: make conf_name_tree per net
nfsd: make unconf_id_hashtbl allocated per net
nfsd: make unconf_name_tree per net
nfsd: make ownerstr_hashtbl allocated per net
nfsd: make lockowner_ino_hashtbl allocated per net
nfsd: make sessionid_hashtbl allocated per net
nfsd: make client_lru list per net
nfsd: make close_lru list per net
nfsd: use service net instead of hard-coded init_net
nfsd: pass nfsd_net instead of net to grace enders
nfsd: make laundromat network namespace aware

 fs/nfsd/netns.h        |   43 +++++
 fs/nfsd/nfs4callback.c |    2 
 fs/nfsd/nfs4proc.c     |   13 +
 fs/nfsd/nfs4recover.c  |  102 ++++++++---
 fs/nfsd/nfs4state.c    |  450 +++++++++++++++++++++++++++---------------------
 fs/nfsd/state.h        |   17 +-
 fs/nfsd/xdr4.h         |    2 
 7 files changed, 389 insertions(+), 240 deletions(-)