Skip to content

nfsd4 state cleanup

J. Bruce Fields linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest25 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/25nfsd4: centralize handling of replay ownersfs/nfsd/nfs4state.c fs/nfsd/nfs4xdr.c+23 -360 replies
2/25nfsd4: cleanup seqid op stateowner usagefs/nfsd/nfs4state.c fs/nfsd/nfs4xdr.c fs/nfsd/xdr4.h+24 -450 replies
3/25nfsd4: extend state lock over seqid replay logicfs/nfsd/nfs4proc.c fs/nfsd/nfs4state.c+11 -65 replies
4/25nfsd4: eliminate impossible open replay casefs/nfsd/nfs4state.c+2 -120 replies
5/25nfsd4: drop most stateowner refcountingfs/nfsd/nfs4proc.c fs/nfsd/nfs4state.c fs/nfsd/nfs4xdr.c +2 more+22 -350 replies
6/25nfsd4: eliminate unused lt_stateownerfs/nfsd/nfs4state.c fs/nfsd/xdr4.h+4 -50 replies
7/25nfsd4: share common seqid checksfs/nfsd/nfs4state.c+21 -200 replies
8/25nfsd4: simplify check_open logicfs/nfsd/nfs4state.c+2 -50 replies
9/25nfsd4: move double-confirm test to open_confirmfs/nfsd/nfs4state.c+5 -70 replies
10/25nfsd4: move CLOSE_STATE special case to callerfs/nfsd/nfs4state.c fs/nfsd/state.h+27 -300 replies
11/25nfsd4: split stateowners into open and lockownersfs/nfsd/nfs4proc.c fs/nfsd/nfs4state.c fs/nfsd/nfs4xdr.c +2 more+224 -1980 replies
12/25nfsd4: split out some free_generic_stateid codefs/nfsd/nfs4state.c+8 -10 replies
13/25nfsd4: rearrange to avoid a forward referencefs/nfsd/nfs4state.c+26 -270 replies
14/25nfsd4: split up find_stateidfs/nfsd/nfs4state.c+21 -130 replies
15/25nfsd4: split preprocess_seqid, cleanupfs/nfsd/nfs4state.c fs/nfsd/state.h+45 -430 replies
16/25nfsd4: pass around typemask instead of flagsfs/nfsd/nfs4state.c fs/nfsd/state.h+8 -120 replies
17/25nfsd4: rename init_stateidfs/nfsd/nfs4state.c+2 -20 replies
18/25nfsd4: remove redundant stateid initializationfs/nfsd/nfs4state.c+0 -70 replies
19/25nfsd4: move some of nfs4_stateid into a separate structurefs/nfsd/nfs4state.c fs/nfsd/state.h+106 -970 replies
20/25nfsd4: add common dl_stid field to delegationfs/nfsd/nfs4callback.c fs/nfsd/nfs4state.c fs/nfsd/state.h+22 -200 replies
21/25nfsd4: share common stid-hashing helper functionfs/nfsd/nfs4state.c+11 -40 replies
22/25nfsd4: hash deleg stateid's like any otherfs/nfsd/nfs4state.c fs/nfsd/state.h+51 -660 replies
23/25nfsd4: fix test_stateid for delegation stateid'sfs/nfsd/nfs4state.c+16 -180 replies
24/25nfsd4: use deleg changes to cleanup preprocess_stateid_opfs/nfsd/nfs4state.c+10 -140 replies
25/25nfsd4: better stateid hashingfs/nfsd/nfs4state.c+4 -40 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/25] nfsd4 state cleanup

This is just another batch of little cleanups and bugfixes to the nfsd4 state code.

What I'm actually thinking I'd like to do next is change the way stateid's are composed to make it possible to look up the client first. Once the client's looked up, lookup of the individual stateid, and most of the following work, looks to me like it could be done under a per-client lock. The set of clients doesn't change very much so we could use locking that favors readers (maybe rcu) for that part. So that could be a first step towards saner locking.

And then also still to do:
- close replays: we keep around a stateid to handle close replays only in the case where it's the last stateid for an openowner, but that's not sufficient.
- the data structures aren't really right for the things we need to do: e.g. release_lockowner currently does a linear search through all the lockowners!
- multiple client-to-lockowner locks for a given (owner, file) aren't handled right.
- I need to look again at doing a better job of distinguishing the bad, expired, and stale cases for stateid's.

I was hoping to have that ready for 3.2 but unfortunately keep running across small bugs or cleanup opportunities like these along the way; perhaps next week....

--b.

J. Bruce Fields (25):
nfsd4: centralize handling of replay owners
nfsd4: cleanup seqid op stateowner usage
nfsd4: extend state lock over seqid replay logic
nfsd4: eliminate impossible open replay case
nfsd4: drop most stateowner refcounting
nfsd4: eliminate unused lt_stateowner
nfsd4: share common seqid checks
nfsd4: simplify check_open logic
nfsd4: move double-confirm test to open_confirm
nfsd4: move CLOSE_STATE special case to caller
nfsd4: split stateowners into open and lockowners
nfsd4: split out some free_generic_stateid code
nfsd4: rearrange to avoid a forward reference
nfsd4: split up find_stateid
nfsd4: split preprocess_seqid, cleanup
nfsd4: pass around typemask instead of flags
nfsd4: rename init_stateid
nfsd4: remove redundant stateid initialization
nfsd4: move some of nfs4_stateid into a separate structure
nfsd4: add common dl_stid field to delegation
nfsd4: share common stid-hashing helper function
nfsd4: hash deleg stateid's like any other
nfsd4: fix test_stateid for delegation stateid's
nfsd4: use deleg changes to cleanup preprocess_stateid_op
nfsd4: better stateid hashing

 fs/nfsd/nfs4callback.c |    2 +-
 fs/nfsd/nfs4proc.c     |   25 +-
 fs/nfsd/nfs4state.c    |  989 +++++++++++++++++++++++-------------------------
 fs/nfsd/nfs4xdr.c      |   52 ++--
 fs/nfsd/state.h        |   92 +++--
 fs/nfsd/xdr4.h         |   12 +-
 6 files changed, 570 insertions(+), 602 deletions(-)
Signature · 1 line
1.7.4.1