diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-11-19 12:47:50 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-12-06 15:55:39 -0800 |
commit | dc3c21a88ffd926ef1ae9eaeb69c999bc94d2cc9 (patch) | |
tree | 93e77e25ddde1a54de19e6bbda29ed00be8b95b2 /net/unix/sysctl_net_unix.c | |
parent | 9942a780b65fb1905b21af6e2be81a079e5eaacc (diff) |
nfsd: Fix slot wake up race in the nfsv4.1 callback code
commit c6c15e1ed303ffc47e696ea1c9a9df1761c1f603 upstream.
The currect code for nfsd41_cb_get_slot() and nfsd4_cb_done() has no
locking in order to guarantee atomicity, and so allows for races of
the form.
Task 1 Task 2
====== ======
if (test_and_set_bit(0) != 0) {
clear_bit(0)
rpc_wake_up_next(queue)
rpc_sleep_on(queue)
return false;
}
This patch breaks the race condition by adding a retest of the bit
after the call to rpc_sleep_on().
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions