lkml.org 
[lkml]   [2011]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] RPC: return task->tk_status from rpc_wait_for_completion_task() in case of successfull task completion
From
Date
Some NFS and NLM routines doesn't check RPC task tk_status if
rpc_wait_for_completion_task() returned 0 but have to.
The best way to handle such RPC task error, from my pow, is to return RPC task
tk_status from rpc_wait_for_completion_task() instead of 0 value.
This approach will cover RPC tasks error status since NFS and NLM routines
checks rpc_wait_for_completion_task() result.

Kernel version affected: 2.6.38

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>

---
include/linux/sunrpc/sched.h | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index d81db80..f733036 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -245,7 +245,12 @@ void rpc_prepare_task(struct rpc_task *task);

static inline int rpc_wait_for_completion_task(struct rpc_task *task)
{
- return __rpc_wait_for_completion_task(task, NULL);
+ int res;
+
+ res = __rpc_wait_for_completion_task(task, NULL);
+ if (res == 0)
+ res = task->tk_status;
+ return res;
}

static inline void rpc_task_set_priority(struct rpc_task *task, unsigned char prio)


\
 
 \ /
  Last update: 2011-03-15 15:23    [W:0.033 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site