linux-stable/fs/nfsd
Jeff Layton 9d60e8ec99 nfsd: hold a lighter-weight client reference over CB_RECALL_ANY
[ Upstream commit 10396f4df8 ]

Currently the CB_RECALL_ANY job takes a cl_rpc_users reference to the
client. While a callback job is technically an RPC that counter is
really more for client-driven RPCs, and this has the effect of
preventing the client from being unhashed until the callback completes.

If nfsd decides to send a CB_RECALL_ANY just as the client reboots, we
can end up in a situation where the callback can't complete on the (now
dead) callback channel, but the new client can't connect because the old
client can't be unhashed. This usually manifests as a NFS4ERR_DELAY
return on the CREATE_SESSION operation.

The job is only holding a reference to the client so it can clear a flag
after the RPC completes. Fix this by having CB_RECALL_ANY instead hold a
reference to the cl_nfsdfs.cl_ref. Typically we only take that sort of
reference when dealing with the nfsdfs info files, but it should work
appropriately here to ensure that the nfs4_client doesn't disappear.

Fixes: 44df6f439a ("NFSD: add delegation reaper to react to low memory condition")
Reported-by: Vladimir Benes <vbenes@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-10 16:36:01 +02:00
..
Kconfig NFS & NFSD: Update GSS dependencies 2023-03-10 09:38:47 -05:00
Makefile
acl.h
auth.c cred: get rid of CONFIG_DEBUG_CREDENTIALS 2023-12-20 17:01:51 +01:00
auth.h
blocklayout.c nfsd: call op_release, even when op_func returns an error 2023-03-31 17:29:49 -04:00
blocklayoutxdr.c NFSD: da_addr_body field missing in some GETDEVICEINFO replies 2023-08-29 17:45:22 -04:00
blocklayoutxdr.h
cache.h NFSD: Fix checksum mismatches in the duplicate reply cache 2023-12-03 07:33:02 +01:00
current_stateid.h
export.c nfsd: remove redundant assignments to variable len 2023-06-21 15:05:32 -04:00
export.h NFSD: Handle new xprtsec= export option 2023-04-27 18:49:24 -04:00
filecache.c nfsd: Handle EOPENSTALE correctly in the filecache 2023-11-20 11:58:52 +01:00
filecache.h NFSD: Convert filecache to rhltable 2023-04-26 09:04:59 -04:00
flexfilelayout.c
flexfilelayoutxdr.c NFSD: da_addr_body field missing in some GETDEVICEINFO replies 2023-08-29 17:45:22 -04:00
flexfilelayoutxdr.h
idmap.h
lockd.c
netns.h File locking changes for v6.3 2023-02-20 11:10:38 -08:00
nfs2acl.c NFSD 6.3 Release Notes 2023-02-22 14:21:40 -08:00
nfs3acl.c NFSD 6.3 Release Notes 2023-02-22 14:21:40 -08:00
nfs3proc.c nfsd: handle failure to collect pre/post-op attrs more sanely 2023-08-29 17:45:22 -04:00
nfs3xdr.c NFSD: Ensure that xdr_write_pages updates rq_next_page 2023-06-05 09:01:44 -04:00
nfs4acl.c nfsd: inherit required unset default acls from effective set 2023-08-29 17:45:22 -04:00
nfs4callback.c NFSD: callback request does not use correct credential for AUTH_SYS 2023-04-04 09:55:27 -04:00
nfs4idmap.c SUNRPC: return proper error from get_expiry() 2023-04-26 09:05:00 -04:00
nfs4layouts.c nfsd: fix race to check ls_layouts 2023-02-20 09:20:56 -05:00
nfs4proc.c nfsd: fix change_info in NFSv4 RENAME replies 2023-09-09 13:24:52 -04:00
nfs4recover.c fs: port vfs_*() helpers to struct mnt_idmap 2023-01-18 17:51:45 +01:00
nfs4state.c nfsd: hold a lighter-weight client reference over CB_RECALL_ANY 2024-04-10 16:36:01 +02:00
nfs4xdr.c NFSD: Fix zero NFSv4 READ results when RQ_SPLICE_OK is not set 2023-09-28 10:34:28 -04:00
nfscache.c NFSD: Fix checksum mismatches in the duplicate reply cache 2023-12-03 07:33:02 +01:00
nfsctl.c nfsd: drop the nfsd_put helper 2024-01-15 18:57:06 +01:00
nfsd.h nfsd: drop the nfsd_put helper 2024-01-15 18:57:06 +01:00
nfsfh.c nfsd: handle failure to collect pre/post-op attrs more sanely 2023-08-29 17:45:22 -04:00
nfsfh.h nfsd: handle failure to collect pre/post-op attrs more sanely 2023-08-29 17:45:22 -04:00
nfsproc.c NFSD: Hoist rq_vec preparation into nfsd_read() 2023-06-11 16:37:45 -04:00
nfssvc.c nfsd: call nfsd_last_thread() before final nfsd_put() 2024-01-01 12:42:42 +00:00
nfsxdr.c NFSD: Ensure that xdr_write_pages updates rq_next_page 2023-06-05 09:01:44 -04:00
pnfs.h
state.h NFSD: handle GETATTR conflict with write delegation 2023-08-29 17:45:22 -04:00
stats.c NFSD: handle GETATTR conflict with write delegation 2023-08-29 17:45:22 -04:00
stats.h NFSD: handle GETATTR conflict with write delegation 2023-08-29 17:45:22 -04:00
trace.c
trace.h NFSD: Fix nfsd_clid_class use of __string_len() macro 2024-04-03 15:28:35 +02:00
vfs.c cred: get rid of CONFIG_DEBUG_CREDENTIALS 2023-12-20 17:01:51 +01:00
vfs.h nfsd: Handle EOPENSTALE correctly in the filecache 2023-11-20 11:58:52 +01:00
xdr.h
xdr3.h
xdr4.h nfsd: remove unsafe BUG_ON from set_change_info 2023-08-29 17:45:22 -04:00
xdr4cb.h