SUNRPC: Add barriers to ensure read ordering in rpc_wake_up_task_queue_locked
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 25 Mar 2013 15:23:40 +0000 (11:23 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 10 Apr 2013 02:20:02 +0000 (03:20 +0100)
commit4e58995c3f1bedc7acfe5e2d2a9f7deebcbdb82f
treea11fe1c6841c8df2db17e62c80c1a11065d78405
parent6273c03e47f9192594311b3d06601c695d2c7171
SUNRPC: Add barriers to ensure read ordering in rpc_wake_up_task_queue_locked

commit 1166fde6a923c30f4351515b6a9a1efc513e7d00 upstream.

We need to be careful when testing task->tk_waitqueue in
rpc_wake_up_task_queue_locked, because it can be changed while we
are holding the queue->lock.
By adding appropriate memory barriers, we can ensure that it is safe to
test task->tk_waitqueue for equality if the RPC_TASK_QUEUED bit is set.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/sunrpc/sched.c