Skip to content

Commit c6f2a81

Browse files
chucklevergregkh
authored andcommitted
NFSD: Skip sending CB_RECALL_ANY when the backchannel isn't up
commit 8a388c1 upstream. NFSD sends CB_RECALL_ANY to clients when the server is low on memory or that client has a large number of delegations outstanding. We've seen cases where NFSD attempts to send CB_RECALL_ANY requests to disconnected clients, and gets confused. These calls never go anywhere if a backchannel transport to the target client isn't available. Before the server can send any backchannel operation, the client has to connect first and then do a BIND_CONN_TO_SESSION. This patch doesn't address the root cause of the confusion, but there's no need to queue up these optional operations if they can't go anywhere. Fixes: 44df6f4 ("NFSD: add delegation reaper to react to low memory condition") Reviewed-by: Jeff Layton <[email protected]> Cc: [email protected] Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent afec5b5 commit c6f2a81

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

fs/nfsd/nfs4state.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6699,14 +6699,19 @@ deleg_reaper(struct nfsd_net *nn)
66996699
spin_lock(&nn->client_lock);
67006700
list_for_each_safe(pos, next, &nn->client_lru) {
67016701
clp = list_entry(pos, struct nfs4_client, cl_lru);
6702-
if (clp->cl_state != NFSD4_ACTIVE ||
6703-
list_empty(&clp->cl_delegations) ||
6704-
atomic_read(&clp->cl_delegs_in_recall) ||
6705-
test_bit(NFSD4_CLIENT_CB_RECALL_ANY, &clp->cl_flags) ||
6706-
(ktime_get_boottime_seconds() -
6707-
clp->cl_ra_time < 5)) {
6702+
6703+
if (clp->cl_state != NFSD4_ACTIVE)
6704+
continue;
6705+
if (list_empty(&clp->cl_delegations))
6706+
continue;
6707+
if (atomic_read(&clp->cl_delegs_in_recall))
6708+
continue;
6709+
if (test_bit(NFSD4_CLIENT_CB_RECALL_ANY, &clp->cl_flags))
6710+
continue;
6711+
if (ktime_get_boottime_seconds() - clp->cl_ra_time < 5)
6712+
continue;
6713+
if (clp->cl_cb_state != NFSD4_CB_UP)
67086714
continue;
6709-
}
67106715
list_add(&clp->cl_ra_cblist, &cblist);
67116716

67126717
/* release in nfsd4_cb_recall_any_release */

0 commit comments

Comments
 (0)