]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: We must not use list_for_each_entry_safe() in rpc_wake_up()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 19 Mar 2012 17:39:35 +0000 (13:39 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 19 Mar 2012 18:15:02 +0000 (14:15 -0400)
commit073ef1bcefda08b2c587a928f8042dda6a18ea2f
tree5a5dede243b80f1dca55f651ff2a78eaccff5c50
parent9bf85f3e7e2a8e9353bc8bcfcf4e7f54a451411f
SUNRPC: We must not use list_for_each_entry_safe() in rpc_wake_up()

The problem is that for the case of priority queues, we
have to assume that __rpc_remove_wait_queue_priority will move new
elements from the tk_wait.links lists into the queue->tasks[] list.
We therefore cannot use list_for_each_entry_safe() on queue->tasks[],
since that will skip these new tasks that __rpc_remove_wait_queue_priority
is adding.

Without this fix, rpc_wake_up and rpc_wake_up_status will both fail
to wake up all functions on priority wait queues, which can result
in some nasty hangs.

Reported-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org
net/sunrpc/sched.c