Skip to content

Commit bad4c58

Browse files
daimngochucklever
authored andcommitted
NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
The NFS server should ask clients to voluntarily return unused delegations when the number of granted delegations reaches the max_delegations. This is so that the server can continue to grant delegations for new requests. Signed-off-by: Dai Ngo <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Tested-by: Chen Hanxiao <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 7d5a352 commit bad4c58

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/nfsd/nfs4state.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ static void nfs4_free_ol_stateid(struct nfs4_stid *stid);
8787
void nfsd4_end_grace(struct nfsd_net *nn);
8888
static void _free_cpntf_state_locked(struct nfsd_net *nn, struct nfs4_cpntf_state *cps);
8989
static void nfsd4_file_hash_remove(struct nfs4_file *fi);
90+
static void deleg_reaper(struct nfsd_net *nn);
9091

9192
/* Locking: */
9293

@@ -6550,6 +6551,8 @@ nfs4_laundromat(struct nfsd_net *nn)
65506551
/* service the server-to-server copy delayed unmount list */
65516552
nfsd4_ssc_expire_umount(nn);
65526553
#endif
6554+
if (atomic_long_read(&num_delegations) >= max_delegations)
6555+
deleg_reaper(nn);
65536556
out:
65546557
return max_t(time64_t, lt.new_timeo, NFSD_LAUNDROMAT_MINTIMEOUT);
65556558
}

0 commit comments

Comments
 (0)