]> git.dujemihanovic.xyz Git - linux.git/commit
nfsd: untangle code in nfsd4_deleg_getattr_conflict()
authorNeilBrown <neilb@suse.de>
Thu, 29 Aug 2024 13:26:40 +0000 (09:26 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 20 Sep 2024 23:31:36 +0000 (19:31 -0400)
commita078a7dc0eaa9db288ae45319f7f7503968af546
tree54537634f10ac657d748125ad7c6f3599c133a21
parent5559c157b79907a901578f93f83eb6732bfcbc1a
nfsd: untangle code in nfsd4_deleg_getattr_conflict()

The code in nfsd4_deleg_getattr_conflict() is convoluted and buggy.

With this patch we:
 - properly handle non-nfsd leases.  We must not assume flc_owner is a
    delegation unless fl_lmops == &nfsd_lease_mng_ops
 - move the main code out of the for loop
 - have a single exit which calls nfs4_put_stid()
   (and other exits which don't need to call that)

[ jlayton: refactored on top of Neil's other patch: nfsd: fix
   nfsd4_deleg_getattr_conflict in presence of third party lease ]

Fixes: c5967721e106 ("NFSD: handle GETATTR conflict with write delegation")
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4state.c