• Trond Myklebust's avatar
    NFSv4: fix delegated locking · 0df5dd4a
    Trond Myklebust authored
    Arnaud Giersch reports that NFSv4 locking is broken when we hold a
    delegation since commit 8e469ebd (NFSv4:
    Don't allow posix locking against servers that don't support it).
    
    According to Arnaud, the lock succeeds the first time he opens the file
    (since we cannot do a delegated open) but then fails after we start using
    delegated opens.
    
    The following patch fixes it by ensuring that locking behaviour is
    governed by a per-filesystem capability flag that is initially set, but
    gets cleared if the server ever returns an OPEN without the
    NFS4_OPEN_RESULT_LOCKTYPE_POSIX flag being set.
    Reported-by: default avatarArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
    Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
    Cc: stable@kernel.org
    0df5dd4a
nfs4proc.c 143 KB