56 lines
2.1 KiB
Diff
56 lines
2.1 KiB
Diff
From 71e2b1f41ebbead746c5b99384ebb9fb7c73a079 Mon Sep 17 00:00:00 2001
|
|
From: Chuck Lever <chuck.lever@oracle.com>
|
|
Date: Tue, 14 Jan 2025 17:09:24 -0500
|
|
Subject: NFSD: Skip sending CB_RECALL_ANY when the backchannel isn't up
|
|
|
|
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: 44df6f439a17 ("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>
|
|
---
|
|
fs/nfsd/nfs4state.c | 19 ++++++++++++-------
|
|
1 file changed, 12 insertions(+), 7 deletions(-)
|
|
|
|
--- a/fs/nfsd/nfs4state.c
|
|
+++ b/fs/nfsd/nfs4state.c
|
|
@@ -6860,14 +6860,19 @@ deleg_reaper(struct nfsd_net *nn)
|
|
spin_lock(&nn->client_lock);
|
|
list_for_each_safe(pos, next, &nn->client_lru) {
|
|
clp = list_entry(pos, struct nfs4_client, cl_lru);
|
|
- if (clp->cl_state != NFSD4_ACTIVE ||
|
|
- list_empty(&clp->cl_delegations) ||
|
|
- atomic_read(&clp->cl_delegs_in_recall) ||
|
|
- test_bit(NFSD4_CLIENT_CB_RECALL_ANY, &clp->cl_flags) ||
|
|
- (ktime_get_boottime_seconds() -
|
|
- clp->cl_ra_time < 5)) {
|
|
+
|
|
+ if (clp->cl_state != NFSD4_ACTIVE)
|
|
+ continue;
|
|
+ if (list_empty(&clp->cl_delegations))
|
|
+ continue;
|
|
+ if (atomic_read(&clp->cl_delegs_in_recall))
|
|
+ continue;
|
|
+ if (test_bit(NFSD4_CLIENT_CB_RECALL_ANY, &clp->cl_flags))
|
|
+ continue;
|
|
+ if (ktime_get_boottime_seconds() - clp->cl_ra_time < 5)
|
|
+ continue;
|
|
+ if (clp->cl_cb_state != NFSD4_CB_UP)
|
|
continue;
|
|
- }
|
|
list_add(&clp->cl_ra_cblist, &cblist);
|
|
|
|
/* release in nfsd4_cb_recall_any_release */
|