Skip to content

Commit 094462a

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 <jlayton@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a9d4c12 commit 094462a

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

fs/nfsd/nfs4state.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6882,14 +6882,19 @@ deleg_reaper(struct nfsd_net *nn)
68826882
spin_lock(&nn->client_lock);
68836883
list_for_each_safe(pos, next, &nn->client_lru) {
68846884
clp = list_entry(pos, struct nfs4_client, cl_lru);
6885-
if (clp->cl_state != NFSD4_ACTIVE ||
6886-
list_empty(&clp->cl_delegations) ||
6887-
atomic_read(&clp->cl_delegs_in_recall) ||
6888-
test_bit(NFSD4_CLIENT_CB_RECALL_ANY, &clp->cl_flags) ||
6889-
(ktime_get_boottime_seconds() -
6890-
clp->cl_ra_time < 5)) {
6885+
6886+
if (clp->cl_state != NFSD4_ACTIVE)
6887+
continue;
6888+
if (list_empty(&clp->cl_delegations))
6889+
continue;
6890+
if (atomic_read(&clp->cl_delegs_in_recall))
6891+
continue;
6892+
if (test_bit(NFSD4_CLIENT_CB_RECALL_ANY, &clp->cl_flags))
6893+
continue;
6894+
if (ktime_get_boottime_seconds() - clp->cl_ra_time < 5)
6895+
continue;
6896+
if (clp->cl_cb_state != NFSD4_CB_UP)
68916897
continue;
6892-
}
68936898
list_add(&clp->cl_ra_cblist, &cblist);
68946899

68956900
/* release in nfsd4_cb_recall_any_release */

0 commit comments

Comments
 (0)