mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 15:01:44 +00:00
[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>
This commit is contained in:
parent
5394cd2187
commit
bde8f00ce6
3 changed files with 5 additions and 7 deletions
|
@ -250,7 +250,6 @@ void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt,
|
||||||
int flags, const struct rpc_call_ops *ops,
|
int flags, const struct rpc_call_ops *ops,
|
||||||
void *data);
|
void *data);
|
||||||
void rpc_put_task(struct rpc_task *);
|
void rpc_put_task(struct rpc_task *);
|
||||||
void rpc_release_task(struct rpc_task *);
|
|
||||||
void rpc_exit_task(struct rpc_task *);
|
void rpc_exit_task(struct rpc_task *);
|
||||||
void rpc_release_calldata(const struct rpc_call_ops *, void *);
|
void rpc_release_calldata(const struct rpc_call_ops *, void *);
|
||||||
void rpc_killall_tasks(struct rpc_clnt *);
|
void rpc_killall_tasks(struct rpc_clnt *);
|
||||||
|
|
|
@ -490,16 +490,14 @@ int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
|
||||||
|
|
||||||
/* Set up the call info struct and execute the task */
|
/* Set up the call info struct and execute the task */
|
||||||
status = task->tk_status;
|
status = task->tk_status;
|
||||||
if (status != 0) {
|
if (status != 0)
|
||||||
rpc_release_task(task);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
atomic_inc(&task->tk_count);
|
atomic_inc(&task->tk_count);
|
||||||
status = rpc_execute(task);
|
status = rpc_execute(task);
|
||||||
if (status == 0)
|
if (status == 0)
|
||||||
status = task->tk_status;
|
status = task->tk_status;
|
||||||
rpc_put_task(task);
|
|
||||||
out:
|
out:
|
||||||
|
rpc_put_task(task);
|
||||||
rpc_restore_sigmask(&oldset);
|
rpc_restore_sigmask(&oldset);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@ -537,7 +535,7 @@ rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, int flags,
|
||||||
if (status == 0)
|
if (status == 0)
|
||||||
rpc_execute(task);
|
rpc_execute(task);
|
||||||
else
|
else
|
||||||
rpc_release_task(task);
|
rpc_put_task(task);
|
||||||
|
|
||||||
rpc_restore_sigmask(&oldset);
|
rpc_restore_sigmask(&oldset);
|
||||||
return status;
|
return status;
|
||||||
|
|
|
@ -42,6 +42,7 @@ static mempool_t *rpc_buffer_mempool __read_mostly;
|
||||||
static void __rpc_default_timer(struct rpc_task *task);
|
static void __rpc_default_timer(struct rpc_task *task);
|
||||||
static void rpciod_killall(void);
|
static void rpciod_killall(void);
|
||||||
static void rpc_async_schedule(struct work_struct *);
|
static void rpc_async_schedule(struct work_struct *);
|
||||||
|
static void rpc_release_task(struct rpc_task *task);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RPC tasks sit here while waiting for conditions to improve.
|
* RPC tasks sit here while waiting for conditions to improve.
|
||||||
|
@ -896,7 +897,7 @@ void rpc_put_task(struct rpc_task *task)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(rpc_put_task);
|
EXPORT_SYMBOL(rpc_put_task);
|
||||||
|
|
||||||
void rpc_release_task(struct rpc_task *task)
|
static void rpc_release_task(struct rpc_task *task)
|
||||||
{
|
{
|
||||||
#ifdef RPC_DEBUG
|
#ifdef RPC_DEBUG
|
||||||
BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID);
|
BUG_ON(task->tk_magic != RPC_TASK_MAGIC_ID);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue