NFSv4: fairly test all delegations on a SEQ4_ revocation
authorBenjamin Coddington <bcodding@redhat.com>
Thu, 24 Aug 2023 18:52:19 +0000 (14:52 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 1 Nov 2023 19:15:52 +0000 (15:15 -0400)
commita9b8d90f87263f985fa14250fc8caf7bfcde8803
tree89b811cc1eb48054d9e45a7ba0b3fe71bae29971
parent59464b262ff5b35840f1af77c52173dee9f4de31
NFSv4: fairly test all delegations on a SEQ4_ revocation

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@redhat.com>
Tested-by: Torkil Svensgaard <torkil@drcmr.dk>
Tested-by: Ruben Vestergaard <rubenv@drcmr.dk>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/delegation.c
fs/nfs/delegation.h
include/linux/nfs_fs_sb.h