Skip to content

RFC fs: nfs: async lock request changes

Alexander Aring cluster-devel linux-fsdevel linux-nfs ocfs2-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 RFC Latest7 patches 14 repliesIn review

changes since v2 from the cover letter

- add dlm fixes/changes to show how the new API should work. It's used by gfs2/ocfs2.
- handle non-blocking request synchronously. For this reason we needed to introduce a new per nlm_block request to fix a race between request and lm_grant() callback handling, see b_cb_mutex
- update documentation for new FL_SLEEP handling when lm_grant() is set and new requirement that lm_grant() need to be called from a sleepable contex.
- clear new CALLBACK PENDING flag when nlm_block is removed from nlm_blocked
- introduce helper export_op_support_safe_async_lock() to check if the filesystem supports asynchronous lock request calls
- fix block variable never NULL when iterating over nlm_blocked list

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7lockd: fix race in async lock request handlingfs/lockd/svclock.c include/linux/lockd/lockd.h+74 -284 replies
2/7lockd: FILE_LOCK_DEFERRED only on FL_SLEEPfs/lockd/svclock.c+7 -322 replies
3/7lockd: introduce safe async lock opfs/lockd/svclock.c fs/nfsd/nfs4state.c include/linux/exportfs.h+20 -61 reply
4/7locks: update lock callback documentationfs/locks.c+14 -142 replies
5/7dlm: use fl_owner from lockdfs/dlm/plock.c+4 -141 reply
6/7dlm: use FL_SLEEP to check if blocking requestfs/dlm/plock.c+22 -164 replies
7/7dlm: implement EXPORT_OP_SAFE_ASYNC_LOCKfs/gfs2/export.c fs/ocfs2/export.c+2 -00 replies

Reviews trailers per patch

2 of 7 patches have a Reviewed-by or Acked-by.

PatchJeff Layton
1/7
2/7
3/7A-b
4/7
5/7A-b
6/7
7/7

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

Read the v2 thread

Cover letter [RFCv2 0/7] fs: nfs: async lock request changes

Hi,

this patch series contains changes to lockd asynchronous lock request handling over vfs_lock_file(). The only one upstream user so far I see is DLM. The current DLM handling of asynchronous lock request is broken. Those patches makes the asynchronous lock request handling better, there are still issues with fencing or lock cancellation that this patch series does not tackle.

The cifs filesystem is another user of FILE_LOCK_DEFERRED but it does not do anything on checking lm_grant() as the asynchronous lock API is required to check if it's set.

- Alex

changes since v2:
- add dlm fixes/changes to show how the new API should work. It's used by gfs2/ocfs2.
- handle non-blocking request synchronously. For this reason we needed to introduce a new per nlm_block request to fix a race between request and lm_grant() callback handling, see b_cb_mutex
- update documentation for new FL_SLEEP handling when lm_grant() is set and new requirement that lm_grant() need to be called from a sleepable contex.
- clear new CALLBACK PENDING flag when nlm_block is removed from nlm_blocked
- introduce helper export_op_support_safe_async_lock() to check if the filesystem supports asynchronous lock request calls
- fix block variable never NULL when iterating over nlm_blocked list

Alexander Aring (7):
lockd: fix race in async lock request handling
lockd: FILE_LOCK_DEFERRED only on FL_SLEEP
lockd: introduce safe async lock op
locks: update lock callback documentation
dlm: use fl_owner from lockd
dlm: use FL_SLEEP to check if blocking request
dlm: implement EXPORT_OP_SAFE_ASYNC_LOCK

 fs/dlm/plock.c              |  54 +++++++-------
 fs/gfs2/export.c            |   1 +
 fs/lockd/svclock.c          | 140 ++++++++++++++++++++----------------
 fs/locks.c                  |  28 ++++----
 fs/nfsd/nfs4state.c         |  13 +++-
 fs/ocfs2/export.c           |   1 +
 include/linux/exportfs.h    |   8 +++
 include/linux/lockd/lockd.h |   2 +
 8 files changed, 140 insertions(+), 107 deletions(-)
Signature · 1 line
2.31.1