linux-stable/fs/nfsd
Jeff Layton befe2f4ed2 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:38:14 +02:00
..
Kconfig nfsd: new Kconfig option for legacy client tracking 2024-01-07 17:54:24 -05:00
Makefile NFSD: introduce netlink stubs 2023-10-16 12:44:09 -04:00
acl.h NFSD: add posix ACLs to struct nfsd_attrs 2022-08-04 10:28:03 -04:00
auth.c cred: get rid of CONFIG_DEBUG_CREDENTIALS 2023-12-15 14:19:48 -08:00
auth.h
blocklayout.c nfsd: convert to new timestamp accessors 2023-10-18 14:08:24 +02:00
blocklayoutxdr.c NFSD: Make @gdev parameter of ->encode_getdeviceinfo a const pointer 2023-10-16 12:44:29 -04:00
blocklayoutxdr.h NFSD: Make @gdev parameter of ->encode_getdeviceinfo a const pointer 2023-10-16 12:44:29 -04:00
cache.h NFSD: Fix checksum mismatches in the duplicate reply cache 2023-11-17 15:13:01 -05:00
current_stateid.h
export.c vfs-6.7.fsid 2023-11-07 12:11:26 -08:00
export.h NFSD: Fix frame size warning in svc_export_parse() 2023-10-16 12:44:39 -04:00
filecache.c NFSD 6.8 Release Notes 2024-01-10 10:20:08 -08:00
filecache.h NFSD: Convert filecache to rhltable 2023-04-26 09:04:59 -04:00
flexfilelayout.c nfsd: move nfserrno() to vfs.c 2022-11-28 12:54:44 -05:00
flexfilelayoutxdr.c NFSD: Make @gdev parameter of ->encode_getdeviceinfo a const pointer 2023-10-16 12:44:29 -04:00
flexfilelayoutxdr.h NFSD: Make @gdev parameter of ->encode_getdeviceinfo a const pointer 2023-10-16 12:44:29 -04:00
idmap.h
lockd.c
netlink.c NFSD: introduce netlink stubs 2023-10-16 12:44:09 -04:00
netlink.h NFSD: introduce netlink stubs 2023-10-16 12:44:09 -04:00
netns.h SUNRPC: discard sv_refcnt, and svc_get/svc_put 2024-01-07 17:54:33 -05: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 6.7 Release Notes 2023-10-30 10:12:29 -10: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 NFSv4, NFSD: move enum nfs_cb_opnum4 to include/linux/nfs4.h 2024-01-07 17:54:26 -05:00
nfs4idmap.c SUNRPC: return proper error from get_expiry() 2023-04-26 09:05:00 -04:00
nfs4layouts.c NFSD: Clean up nfsd4_encode_layoutreturn() 2023-10-16 12:44:29 -04:00
nfs4proc.c NFSD: Modify NFSv4 to use nfsd_read_splice_ok() 2024-01-07 17:54:25 -05:00
nfs4recover.c nfsd: new Kconfig option for legacy client tracking 2024-01-07 17:54:24 -05:00
nfs4state.c nfsd: hold a lighter-weight client reference over CB_RECALL_ANY 2024-04-10 16:38:14 +02:00
nfs4xdr.c NFSD: Modify NFSv4 to use nfsd_read_splice_ok() 2024-01-07 17:54:25 -05:00
nfscache.c NFSD: Remove nfsd_drc_gc() tracepoint 2024-01-07 17:54:25 -05:00
nfsctl.c misc cleanups (the part that hadn't been picked by individual fs trees) 2024-01-11 20:23:50 -08:00
nfsd.h nfsd: rename nfsd_last_thread() to nfsd_destroy_serv() 2024-01-07 17:54:33 -05:00
nfsfh.c NFSD: Add nfsd4_encode_fattr4_change() 2023-10-16 12:44:14 -04:00
nfsfh.h NFSD: Add nfsd4_encode_fattr4_change() 2023-10-16 12:44:14 -04:00
nfsproc.c NFSD: Hoist rq_vec preparation into nfsd_read() 2023-06-11 16:37:45 -04:00
nfssvc.c nfsd: rename nfsd_last_thread() to nfsd_destroy_serv() 2024-01-07 17:54:33 -05:00
nfsxdr.c NFSD: Ensure that xdr_write_pages updates rq_next_page 2023-06-05 09:01:44 -04:00
pnfs.h NFSD: Make @gdev parameter of ->encode_getdeviceinfo a const pointer 2023-10-16 12:44:29 -04:00
state.h NFSD: Revert 738401a9bd 2023-12-18 11:22:19 -05:00
stats.c NFSD: Rewrite synopsis of nfsd_percpu_counters_init() 2023-10-16 12:44:39 -04:00
stats.h NFSD: Fix frame size warning in svc_export_parse() 2023-10-16 12:44:39 -04:00
trace.c
trace.h NFSD: Fix nfsd_clid_class use of __string_len() macro 2024-04-03 15:32:24 +02:00
vfs.c nfsd: Fix error cleanup path in nfsd_rename() 2024-04-10 16:37:54 +02:00
vfs.h NFSD: Replace RQ_SPLICE_OK in nfsd_read() 2024-01-07 17:54:25 -05:00
xdr.h NFSD: prevent underflow in nfssvc_decode_writeargs() 2022-03-15 09:35:56 -04:00
xdr3.h
xdr4.h NFSD: Modify NFSv4 to use nfsd_read_splice_ok() 2024-01-07 17:54:25 -05:00
xdr4cb.h NFSD: Revert 738401a9bd 2023-12-18 11:22:19 -05:00