]> git.karo-electronics.de Git - karo-tx-linux.git/commit
NFS: Fix fcntl F_GETLK not reporting some conflicts
authorSergey Vlasov <vsu@altlinux.ru>
Sun, 28 Nov 2010 21:04:05 +0000 (21:04 +0000)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 17 Apr 2011 20:16:07 +0000 (16:16 -0400)
commitc0430f6fd2c0c2a7fa794df1d041752f9bb938ef
treecf9a665136a38ea13214a403bb1040c3007677d5
parent85f936885acc911d44cca888dcf313a0aa5adfa1
NFS: Fix fcntl F_GETLK not reporting some conflicts

commit 21ac19d484a8ffb66f64487846c8d53afef04d2b upstream.

The commit 129a84de2347002f09721cda3155ccfd19fade40 (locks: fix F_GETLK
regression (failure to find conflicts)) fixed the posix_test_lock()
function by itself, however, its usage in NFS changed by the commit
9d6a8c5c213e34c475e72b245a8eb709258e968c (locks: give posix_test_lock
same interface as ->lock) remained broken - subsequent NFS-specific
locking code received F_UNLCK instead of the user-specified lock type.
To fix the problem, fl->fl_type needs to be saved before the
posix_test_lock() call and restored if no local conflicts were reported.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=23892
Tested-by: Alexander Morozov <amorozov@etersoft.ru>
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
fs/nfs/file.c