]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfs: fix nonblocking calls to nfs_page_group_lock
authorWeston Andros Adamson <dros@primarydata.com>
Mon, 15 Sep 2014 18:14:40 +0000 (14:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 20:41:00 +0000 (13:41 -0700)
commit28c86fda6b1d637bac19a72c5db5cce90b043b95
tree345f61663667b81cfce80db6ef18935a4a1dc37e
parent6483253a3f2ce76bee51e0ac7f98d6c0ee8df08d
nfs: fix nonblocking calls to nfs_page_group_lock

commit bc8a309e88a86205fc3e17f06e42a2e56fc6f807 upstream.

nfs_page_group_lock was calling wait_on_bit_lock even when told not to
block. Fix by first trying test_and_set_bit, followed by wait_on_bit_lock
if and only if blocking is allowed.  Return -EAGAIN if nonblocking and the
test_and_set of the bit was already locked.

Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Reviewed-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pagelist.c