Skip to content

Tighten up locking around stateids in knfsd

Trond Myklebust linux-nfs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 4 repliesIn review
  2. v15 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Add a fix for when nfs4_get_vfs_file() fails in nfsd4_process_open2()
- Add a fix for byte range lock creation

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7nfsd: Fix stateid races between OPEN and CLOSEfs/nfsd/nfs4state.c+59 -80 replies
2/7nfsd: Fix another OPEN stateid racefs/nfsd/nfs4state.c+13 -150 replies
3/7nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0)fs/nfsd/nfs4state.c+8 -00 replies
4/7nfsd: Ensure we don't recognise lock stateids after freeing themfs/nfsd/nfs4state.c+8 -110 replies
5/7nfsd: Fix race in lock stateid creationfs/nfsd/nfs4state.c+59 -451 reply
6/7nfsd: Ensure we check stateid validity in the seqid operation checksfs/nfsd/nfs4state.c+3 -90 replies
7/7nfsd: Fix races with check_stateid_generation()fs/nfsd/nfs4state.c+19 -30 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/7] Tighten up locking around stateids in knfsd

This patchset aims to tighten up the locking rules around stateids to ensure that knfsd does not reuse stateids that have already been closed or invalidated. The aim is to ensure we enforce the RFC5661 and RFC7530 rules concerning stateid initialisation and updates.

v2:
- Add a fix for when nfs4_get_vfs_file() fails in nfsd4_process_open2()
- Add a fix for byte range lock creation

Note that byte range locks are not completely fixed. The remaining task of ensuring that locks don't conflict with CLOSE has been left as an exercise for the reviewer.

Trond Myklebust (7):
nfsd: Fix stateid races between OPEN and CLOSE
nfsd: Fix another OPEN stateid race
nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x

    (x>0)

nfsd: Ensure we don't recognise lock stateids after freeing them
nfsd: Fix race in lock stateid creation
nfsd: Ensure we check stateid validity in the seqid operation checks
nfsd: Fix races with check_stateid_generation()

 fs/nfsd/nfs4state.c | 254 ++++++++++++++++++++++++++++++++++------------------
 1 file changed, 166 insertions(+), 88 deletions(-)
Signature · 1 line
2.13.6