nfsd: allow layout state to be admin-revoked.
authorNeilBrown <neilb@suse.de>
Tue, 30 Jan 2024 01:08:33 +0000 (12:08 +1100)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 1 Mar 2024 14:12:22 +0000 (09:12 -0500)
commit1e33e1414bec54a4feafa9e67e2617031be0afe2
tree03f695fdca10627e21d8c803d1099a92b7c0d5d6
parent06efa66750a68ccd79097b6b03361a0ba358d292
nfsd: allow layout state to be admin-revoked.

When there is layout state on a filesystem that is being "unlocked" that
is now revoked, which involves closing the nfsd_file and releasing the
vfs lease.

To avoid races, ->ls_file can now be accessed either:
 - under ->fi_lock for the state's sc_file or
 - under rcu_read_lock() if nfsd_file_get() is used.
To support this, ->fence_client and nfsd4_cb_layout_fail() now take a
second argument being the nfsd_file.

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/blocklayout.c
fs/nfsd/nfs4layouts.c
fs/nfsd/nfs4state.c
fs/nfsd/pnfs.h