On 24 Aug 2023, at 14:52, Benjamin Coddington wrote: > When the client is required to use TEST_STATEID to discover which > delegation(s) have been revoked, it may continually test delegations at the > head of the list if the server continues to be unsatisfied and send > SEQ4_STATUS_RECALLABLE_STATE_REVOKED. For a large number of delegations > this behavior is prone to live-lock because the client may never be able to > test and free revoked state at the end of the list since the > SEQ4_STATUS_RECALLABLE_STATE_REVOKED will cause us to flag delegations at > the head of the list to be tested. This problem is further exacerbated by > the state manager's willingness to be scheduled out on a busy system while > testing the list of delegations. > > Keep a generation counter for each attempt to test all delegations, and > skip delegations that have already been tested in the current pass. > > Signed-off-by: Benjamin Coddington <bcodding@xxxxxxxxxx> > --- > fs/nfs/delegation.c | 7 ++++++- > fs/nfs/delegation.h | 1 + > include/linux/nfs_fs_sb.h | 1 + > 3 files changed, 8 insertions(+), 1 deletion(-) > > -- > > Changed on v2: remove extra brackets that had my debug statements Hi potential reviewers - this can also be fixed with the simple addition of a flag instead of a counter on every delegation, the only cost being that nfs_server_reap_expired_delegations() would need to walk the whole list a final time to remove the flag before returning. The unsigned long counter is probably overkill. Any thoughts? Ben