]> git.baikalelectronics.ru Git - kernel.git/commit
nfs: fix nonblocking calls to nfs_page_group_lock
authorWeston Andros Adamson <dros@primarydata.com>
Fri, 8 Aug 2014 15:00:54 +0000 (11:00 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Fri, 22 Aug 2014 22:04:42 +0000 (18:04 -0400)
commit69846ee0cb5e3f54096a0ac8203ffc3d373d1770
tree3a3df69f6e7a6e16fc6a816e2e4ee1d0544ec8cb
parentb0c5107d67bf524b2f3c88f676f6cf6502c4a714
nfs: fix nonblocking calls to nfs_page_group_lock

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>
fs/nfs/pagelist.c