]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
NFSD: Enforce timeout on layout recall and integrate lease manager fencing
authorDai Ngo <dai.ngo@oracle.com>
Fri, 13 Feb 2026 18:36:30 +0000 (10:36 -0800)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 30 Mar 2026 01:25:09 +0000 (21:25 -0400)
commitf52792f484ba2316853736856dde19b7e7458861
tree3345ab39da8bb124384c5a8365b9a07e6924f6ef
parentb48f44f36e6607b2f818560f19deb86b4a9c717b
NFSD: Enforce timeout on layout recall and integrate lease manager fencing

When a layout conflict triggers a recall, enforcing a timeout is
necessary to prevent excessive nfsd threads from being blocked in
__break_lease ensuring the server continues servicing incoming
requests efficiently.

This patch introduces a new function to lease_manager_operations:

lm_breaker_timedout: Invoked when a lease recall times out and is
about to be disposed of. This function enables the lease manager
to inform the caller whether the file_lease should remain on the
flc_list or be disposed of.

For the NFSD lease manager, this function now handles layout recall
timeouts. If the layout type supports fencing and the client has not
been fenced, a fence operation is triggered to prevent the client
from accessing the block device.

While the fencing operation is in progress, the conflicting file_lease
remains on the flc_list until fencing is complete. This guarantees
that no other clients can access the file, and the client with
exclusive access is properly blocked before disposal.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Documentation/admin-guide/nfs/pnfs-block-server.rst
Documentation/admin-guide/nfs/pnfs-scsi-server.rst
Documentation/filesystems/locking.rst
fs/locks.c
fs/nfsd/blocklayout.c
fs/nfsd/nfs4layouts.c
fs/nfsd/nfs4state.c
fs/nfsd/pnfs.h
fs/nfsd/state.h
include/linux/filelock.h