]> git.baikalelectronics.ru Git - kernel.git/commit
NFSv4: fix delegated locking
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 11 Apr 2010 20:48:44 +0000 (16:48 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 12 Apr 2010 11:55:15 +0000 (07:55 -0400)
commit33ba384fa634a6898ad15ed65d11042ad23273f3
tree6e58bc436b873cf582f20cf0dbd21461c0a56837
parente9e076233c08fe89d1523addb33a96ffa16b4139
NFSv4: fix delegated locking

Arnaud Giersch reports that NFSv4 locking is broken when we hold a
delegation since commit 03aa2fab0b15e0e0f1126306db9a53ce52212545 (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: Arnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@kernel.org
fs/nfs/client.c
fs/nfs/nfs4proc.c
include/linux/nfs_fs_sb.h