]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfsd: prepare for supporting admin-revocation of state
authorNeilBrown <neilb@suse.de>
Tue, 30 Jan 2024 01:08:26 +0000 (12:08 +1100)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 1 Mar 2024 14:12:19 +0000 (09:12 -0500)
commit1ac3629bf012592cb0320e52a1cceb319a05ad17
tree76ac786fb1c600e5ee6d5c1c5e8a9d1e17ab2c9d
parent3f29cc82a84c23cfd12b903029dd26002ca825f5
nfsd: prepare for supporting admin-revocation of state

The NFSv4 protocol allows state to be revoked by the admin and has error
codes which allow this to be communicated to the client.

This patch
 - introduces a new state-id status SC_STATUS_ADMIN_REVOKED
   which can be set on open, lock, or delegation state.
 - reports NFS4ERR_ADMIN_REVOKED when these are accessed
 - introduces a per-client counter of these states and returns
   SEQ4_STATUS_ADMIN_STATE_REVOKED when the counter is not zero.
   Decrements this when freeing any admin-revoked state.
 - introduces stub code to find all interesting states for a given
   superblock so they can be revoked via the 'unlock_filesystem'
   file in /proc/fs/nfsd/
   No actual states are handled yet.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c
fs/nfsd/nfsctl.c
fs/nfsd/nfsd.h
fs/nfsd/state.h
fs/nfsd/trace.h