diff options
author | Dai Ngo <dai.ngo@oracle.com> | 2024-03-03 23:23:02 +0100 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-03-05 16:22:33 +0100 |
commit | bad4c585ccaaf53c23fbf2b221b88c24576a80fd (patch) | |
tree | 06c42d7f7be272cb62ab51fb3c9940c0ac54e61a /fs/nfsd/nfs4state.c | |
parent | NFSD: Document nfsd_setattr() fill-attributes behavior (diff) | |
download | linux-bad4c585ccaaf53c23fbf2b221b88c24576a80fd.tar.xz linux-bad4c585ccaaf53c23fbf2b221b88c24576a80fd.zip |
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 <dai.ngo@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Tested-by: Chen Hanxiao <chenhx.fnst@fujitsu.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r-- | fs/nfsd/nfs4state.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index aee12adf0598..ee9aa4843443 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -87,6 +87,7 @@ static void nfs4_free_ol_stateid(struct nfs4_stid *stid); void nfsd4_end_grace(struct nfsd_net *nn); static void _free_cpntf_state_locked(struct nfsd_net *nn, struct nfs4_cpntf_state *cps); static void nfsd4_file_hash_remove(struct nfs4_file *fi); +static void deleg_reaper(struct nfsd_net *nn); /* Locking: */ @@ -6550,6 +6551,8 @@ nfs4_laundromat(struct nfsd_net *nn) /* service the server-to-server copy delayed unmount list */ nfsd4_ssc_expire_umount(nn); #endif + if (atomic_long_read(&num_delegations) >= max_delegations) + deleg_reaper(nn); out: return max_t(time64_t, lt.new_timeo, NFSD_LAUNDROMAT_MINTIMEOUT); } |