diff options
| author | Jeff Layton <jlayton@kernel.org> | 2025-12-04 08:48:33 -0500 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-12-15 15:20:33 +0100 |
| commit | 12965a190eaea614bb49e22041e8fc0d03d0310f (patch) | |
| tree | dbe3ed4714f1f175c804370716cca79e4107e32d /Documentation | |
| parent | 392e317a20c32d45eebe4de8dc24408c6d1765d1 (diff) | |
filelock: allow lease_managers to dictate what qualifies as a conflict
Requesting a delegation on a file from the userland fcntl() interface
currently succeeds when there are conflicting opens present.
This is because the lease handling code ignores conflicting opens for
FL_LAYOUT and FL_DELEG leases. This was a hack put in place long ago,
because nfsd already checks for conflicts in its own way. The kernel
needs to perform this check for userland delegations the same way it is
done for leases, however.
Make this dependent on the lease_manager by adding a new
->lm_open_conflict() lease_manager operation and have
generic_add_lease() call that instead of check_conflicting_open().
Morph check_conflicting_open() into a ->lm_open_conflict() op that is
only called for userland leases/delegations. Set the
->lm_open_conflict() operations for nfsd to trivial functions that
always return 0.
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20251204-dir-deleg-ro-v2-2-22d37f92ce2c@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'Documentation')
| -rw-r--r-- | Documentation/filesystems/locking.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/filesystems/locking.rst b/Documentation/filesystems/locking.rst index 77704fde9845..04c7691e50e0 100644 --- a/Documentation/filesystems/locking.rst +++ b/Documentation/filesystems/locking.rst @@ -416,6 +416,7 @@ lm_change yes no no lm_breaker_owns_lease: yes no no lm_lock_expirable yes no no lm_expire_lock no no yes +lm_open_conflict yes no no ====================== ============= ================= ========= buffer_head |
