Skip to content

fix potential races in lockd and nfs4-callback startup/shutdown

Jeff Layton linux-nfs lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3nfs4: remove BKL from nfs_callback_up and nfs_callback_downfs/nfs/callback.c+0 -40 replies
2/3nfs4: fix potential race with rapid nfs_callback_up/down cyclefs/nfs/callback.c+16 -140 replies
3/3lockd: close potential race with rapid lockd_up/lockd_down cyclefs/lockd/svc.c+13 -201 reply

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] fix potential races in lockd and nfs4-callback startup/shutdown

As Trond Myklebust pointed out, the current kthread-based lockd and nfsv4 callback threads have a race condition if they are started and brought down very rapidly. If this occurs, there is a chance that the main thread function will never be run, and the cleanup done when the function exits will not occur. This patchset fixes this by moving the cleanup into the respective *_down functions.

While Bruce has just taken in a patchset from me to change nfsd to kthreads, this race doesn't seem to exist there. We aren't using kthread_stop() to take down nfsd, only signals, so I don't think the kthread can be stopped before nfsd() actually runs.

The set also includes a patch to remove the BKL from nfs_callback_up and nfs_callback_down.