linux-stable/fs/nfsd
Benjamin Coddington 14fa028a2e nfsd: Fix race to FREE_STATEID and cl_revoked
commit 3b816601e2 upstream.

We have some reports of linux NFS clients that cannot satisfy a linux knfsd
server that always sets SEQ4_STATUS_RECALLABLE_STATE_REVOKED even though
those clients repeatedly walk all their known state using TEST_STATEID and
receive NFS4_OK for all.

Its possible for revoke_delegation() to set NFS4_REVOKED_DELEG_STID, then
nfsd4_free_stateid() finds the delegation and returns NFS4_OK to
FREE_STATEID.  Afterward, revoke_delegation() moves the same delegation to
cl_revoked.  This would produce the observed client/server effect.

Fix this by ensuring that the setting of sc_type to NFS4_REVOKED_DELEG_STID
and move to cl_revoked happens within the same cl_lock.  This will allow
nfsd4_free_stateid() to properly remove the delegation from cl_revoked.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2217103
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2176575
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Cc: stable@vger.kernel.org # v4.17+
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-30 14:52:40 +02:00
..
acl.h
auth.c
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
blocklayoutxdr.h
cache.h nfsd: move init of percpu reply_cache_stats counters back to nfsd_init_net 2023-07-19 16:36:51 +02:00
current_stateid.h
export.c NFSD: Handle new xprtsec= export option 2023-04-27 18:49:24 -04:00
export.h NFSD: Handle new xprtsec= export option 2023-04-27 18:49:24 -04:00
filecache.c NFSD: Fix problem of COMMIT and NFS4ERR_DELAY in infinite loop 2023-04-27 18:49:24 -04:00
filecache.h NFSD: Convert filecache to rhltable 2023-04-26 09:04:59 -04:00
flexfilelayout.c
flexfilelayoutxdr.c
flexfilelayoutxdr.h
idmap.h
Kconfig NFS & NFSD: Update GSS dependencies 2023-03-10 09:38:47 -05:00
lockd.c
Makefile
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 6.3 Release Notes 2023-02-22 14:21:40 -08:00
nfs3xdr.c
nfs4acl.c
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 problems with cleanup on errors in nfsd4_copy 2023-02-20 09:20:57 -05:00
nfs4recover.c fs: port vfs_*() helpers to struct mnt_idmap 2023-01-18 17:51:45 +01:00
nfs4state.c nfsd: Fix race to FREE_STATEID and cl_revoked 2023-08-30 14:52:40 +02:00
nfs4xdr.c NFSD: add encoding of op_recall flag for write delegation 2023-07-19 16:36:51 +02:00
nfscache.c nfsd: move init of percpu reply_cache_stats counters back to nfsd_init_net 2023-07-19 16:36:51 +02:00
nfsctl.c nfsd: move init of percpu reply_cache_stats counters back to nfsd_init_net 2023-07-19 16:36:51 +02:00
nfsd.h SUNRPC: Refactor RPC server dispatch method 2023-02-20 09:20:31 -05:00
nfsfh.c fs.idmapped.v6.3 2023-02-20 11:53:11 -08:00
nfsfh.h nfsd: move nfsd4_change_attribute to nfsfh.c 2023-01-26 07:00:06 -05:00
nfsproc.c NFSD 6.3 Release Notes 2023-02-22 14:21:40 -08:00
nfssvc.c NFSD: copy the whole verifier in nfsd_copy_write_verifier 2023-02-20 09:20:59 -05:00
nfsxdr.c
pnfs.h
state.h nfsd: don't take nfsd4_copy ref for OP_OFFLOAD_STATUS 2023-02-20 09:20:51 -05:00
stats.c
stats.h
trace.c
trace.h NFSD: Remove open coding of string copy 2023-05-15 08:03:04 -04:00
vfs.c nfsd: use vfs setgid helper 2023-07-19 16:36:54 +02:00
vfs.h nfsd: use the getattr operation to fetch i_version 2023-01-26 07:00:06 -05:00
xdr.h
xdr3.h
xdr4.h NFSD: enhance inter-server copy cleanup 2023-02-20 09:20:21 -05:00
xdr4cb.h NFSD: add support for sending CB_RECALL_ANY 2022-12-10 11:01:12 -05:00