linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RPC: return task->tk_status from rpc_wait_for_completion_task() in case of successfull task completion
@ 2011-03-15 14:20 Stanislav Kinsbursky
       [not found] ` <20110315141951.16564.72417.stgit-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Stanislav Kinsbursky @ 2011-03-15 14:20 UTC (permalink / raw)
  To: Trond.Myklebust
  Cc: linux-nfs, xemul, neilb, linux-kernel, bfields, skinsbursky

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)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-15 17:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15 14:20 [PATCH] RPC: return task->tk_status from rpc_wait_for_completion_task() in case of successfull task completion Stanislav Kinsbursky
     [not found] ` <20110315141951.16564.72417.stgit-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2011-03-15 14:26   ` Trond Myklebust
     [not found]     ` <1300199215.14093.1.camel-SyLVLa/KEI9HwK5hSS5vWB2eb7JE58TQ@public.gmane.org>
2011-03-15 17:36       ` Stanislav Kinsbursky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).