projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
359c48c
)
SUNRPC: Test whether the task is queued before grabbing the queue spinlocks
author
Trond Myklebust
<trond.myklebust@hammerspace.com>
Sat, 8 Sep 2018 03:15:35 +0000
(23:15 -0400)
committer
Trond Myklebust
<trond.myklebust@hammerspace.com>
Sun, 30 Sep 2018 19:35:14 +0000
(15:35 -0400)
When asked to wake up an RPC task, it makes sense to test whether or not
the task is still queued.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/sched.c
patch
|
blob
|
history
diff --git
a/net/sunrpc/sched.c
b/net/sunrpc/sched.c
index dec01bd1b71ce8da7ff2fd954da12e02abe3a1c2..9a8ec012b449919d68c09a8a93bd59c6b5473397 100644
(file)
--- a/
net/sunrpc/sched.c
+++ b/
net/sunrpc/sched.c
@@
-479,6
+479,8
@@
void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq,
struct rpc_wait_queue *queue,
struct rpc_task *task)
{
+ if (!RPC_IS_QUEUED(task))
+ return;
spin_lock_bh(&queue->lock);
rpc_wake_up_task_on_wq_queue_locked(wq, queue, task);
spin_unlock_bh(&queue->lock);
@@
-489,6
+491,8
@@
void rpc_wake_up_queued_task_on_wq(struct workqueue_struct *wq,
*/
void rpc_wake_up_queued_task(struct rpc_wait_queue *queue, struct rpc_task *task)
{
+ if (!RPC_IS_QUEUED(task))
+ return;
spin_lock_bh(&queue->lock);
rpc_wake_up_task_queue_locked(queue, task);
spin_unlock_bh(&queue->lock);