Suhas Athani has uploaded this change for review.

View Change

Optimisation to avoid same-client lock-path delegation recall in FSAL_UP

This patch is proposed as an optimised solution for patch -
https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/1235527

This change fixes recall24 by preventing spurious NFS delegation recall
when a backend upcall arrives during same-client lock/open-mode transitions.

With Ceph delegation callbacks, lock-driven reopen activity could trigger
up_async_delegrecall, leading to delegrecall_one / CB_RECALL even when all
active locks belong to the same client that owns the delegation.

Added a guard in FSAL_UP (delegrecall_impl_per_state) to skip recall when
all tracked active NFSv4 locks on the file belong to the same clientid as
the delegation owner. In that case, delegation state is restored to
DELEG_GRANTED and CB_RECALL is not issued.

Optimization:
- Add lock_clientid_hint on struct state_file, maintained in state_lock.c
when locks are added, removed, or wiped.
- First lock records that client’s clientid; a lock from a different client
sets the hint to UINT64_MAX , clearing the last lock resets the hint to 0.
- delegrecall_skip_for_same_client_locks() uses this hint to check instead
of iterating file.lock_list.

This test case is from nfstest delegation suite -
https://github.com/kofemann/nfstest/blob/master/test/nfstest_delegation

Change-Id: I1e33457561db047b311d310e5e1238d4d6f69065
Signed-off-by: Suhas Athani <Suhas.Athani@ibm.com>
---
M src/FSAL_UP/fsal_up_top.c
M src/SAL/state_lock.c
M src/include/sal_data.h
M src/include/sal_functions.h
4 files changed, 129 insertions(+), 37 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/66/1238566/1

To view, visit change 1238566. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I1e33457561db047b311d310e5e1238d4d6f69065
Gerrit-Change-Number: 1238566
Gerrit-PatchSet: 1
Gerrit-Owner: Suhas Athani <Suhas.Athani@ibm.com>