• NeilBrown's avatar
    nfsd: untangle code in nfsd4_deleg_getattr_conflict() · a078a7dc
    NeilBrown authored
    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: c5967721 ("NFSD: handle GETATTR conflict with write delegation")
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    a078a7dc
nfs4state.c 232 KB