diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-01-24 14:54:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-24 15:31:06 -0500 |
commit | bde8f00ce64d9824a4f227c8594e335a1a10d044 (patch) | |
tree | 5402180d3aef332c54e7b608f5bb3f94675ffadf | |
parent | 5394cd218735bf462e72bb827fbb7e47fc15f2f0 (diff) |
[PATCH] NFS: Fix Oops in rpc_call_sync()
Fix the Oops in http://bugzilla.linux-nfs.org/show_bug.cgi?id=138
We shouldn't be calling rpc_release_task() for tasks that are not active.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/sunrpc/sched.h | 1 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 8 | ||||
-rw-r--r-- | net/sunrpc/sched.c | 3 |
3 files changed, 5 insertions, 7 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 97c761652581..8b6ce60ea057 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -250,7 +250,6 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, | |||
250 | int flags, const struct rpc_call_ops *ops, | 250 | int flags, const struct rpc_call_ops *ops, |
251 | void *data); | 251 | void *data); |
252 | void rpc_put_task(struct rpc_task *); | 252 | void rpc_put_task(struct rpc_task *); |
253 | void rpc_release_task(struct rpc_task *); | ||
254 | void rpc_exit_task(struct rpc_task *); | 253 | void rpc_exit_task(struct rpc_task *); |
255 | void rpc_release_calldata(const struct rpc_call_ops *, void *); | 254 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
256 | void rpc_killall_tasks(struct rpc_clnt *); | 255 | void rpc_killall_tasks(struct rpc_clnt *); |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index aba528b9ae76..16c9fbc1db69 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -490,16 +490,14 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags) | |||
490 | 490 | ||
491 | /* Set up the call info struct and execute the task */ | 491 | /* Set up the call info struct and execute the task */ |
492 | status = task->tk_status; | 492 | status = task->tk_status; |
493 | if (status != 0) { | 493 | if (status != 0) |
494 | rpc_release_task(task); | ||
495 | goto out; | 494 | goto out; |
496 | } | ||
497 | atomic_inc(&task->tk_count); | 495 | atomic_inc(&task->tk_count); |
498 | status = rpc_execute(task); | 496 | status = rpc_execute(task); |
499 | if (status == 0) | 497 | if (status == 0) |
500 | status = task->tk_status; | 498 | status = task->tk_status; |
501 | rpc_put_task(task); | ||
502 | out: | 499 | out: |
500 | rpc_put_task(task); | ||
503 | rpc_restore_sigmask(&oldset); | 501 | rpc_restore_sigmask(&oldset); |
504 | return status; | 502 | return status; |
505 | } | 503 | } |
@@ -537,7 +535,7 @@ rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, int flags, | |||
537 | if (status == 0) | 535 | if (status == 0) |
538 | rpc_execute(task); | 536 | rpc_execute(task); |
539 | else | 537 | else |
540 | rpc_release_task(task); | 538 | rpc_put_task(task); |
541 | 539 | ||
542 | rpc_restore_sigmask(&oldset); | 540 | rpc_restore_sigmask(&oldset); |
543 | return status; | 541 | return status; |
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 79bc4cdf5d48..fc083f0b3544 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -42,6 +42,7 @@ static mempool_t *rpc_buffer_mempool __read_mostly; | |||
42 | static void __rpc_default_timer(struct rpc_task *task); | 42 | static void __rpc_default_timer(struct rpc_task *task); |
43 | static void rpciod_killall(void); | 43 | static void rpciod_killall(void); |
44 | static void rpc_async_schedule(struct work_struct *); | 44 | static void rpc_async_schedule(struct work_struct *); |
45 | static void rpc_release_task(struct rpc_task *task); | ||
45 | 46 | ||
46 | /* | 47 | /* |
47 | * RPC tasks sit here while waiting for conditions to improve. | 48 | * RPC tasks sit here while waiting for conditions to improve. |
@@ -896,7 +897,7 @@ void rpc_put_task(struct rpc_task *task) | |||
896 | } | 897 | } |
897 | EXPORT_SYMBOL(rpc_put_task); | 898 | EXPORT_SYMBOL(rpc_put_task); |
898 | 899 | ||
899 | void rpc_release_task(struct rpc_task *task) | 900 | static void rpc_release_task(struct rpc_task *task) |
900 | { | 901 | { |
901 | #ifdef RPC_DEBUG | 902 | #ifdef RPC_DEBUG |
902 | BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID); | 903 | BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID); |