* [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
* Re: [PATCH] RPC: return task->tk_status from rpc_wait_for_completion_task() in case of successfull task completion
[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>
0 siblings, 1 reply; 3+ messages in thread
From: Trond Myklebust @ 2011-03-15 14:26 UTC (permalink / raw)
To: Stanislav Kinsbursky
Cc: linux-nfs, xemul, neilb, linux-kernel, bfields, skinsbursky
On Tue, 2011-03-15 at 17:20 +0300, Stanislav Kinsbursky wrote:
> Some NFS and NLM routines doesn't check RPC task tk_status if
> rpc_wait_for_completion_task() returned 0 but have to.
Examples please. I'm not aware of any such cases.
Cheers
Trond
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RPC: return task->tk_status from rpc_wait_for_completion_task() in case of successfull task completion
[not found] ` <1300199215.14093.1.camel-SyLVLa/KEI9HwK5hSS5vWB2eb7JE58TQ@public.gmane.org>
@ 2011-03-15 17:36 ` Stanislav Kinsbursky
0 siblings, 0 replies; 3+ messages in thread
From: Stanislav Kinsbursky @ 2011-03-15 17:36 UTC (permalink / raw)
To: Trond Myklebust
Cc: linux-nfs@vger.kernel.org, Pavel Emelianov, neilb@suse.de,
linux-kernel@vger.kernel.org, bfields@fieldses.org,
skinsbursky@openvz.org
15.03.2011 17:26, Trond Myklebust =D0=BF=D0=B8=D1=88=D0=B5=D1=82:
> On Tue, 2011-03-15 at 17:20 +0300, Stanislav Kinsbursky wrote:
>> Some NFS and NLM routines doesn't check RPC task tk_status if
>> rpc_wait_for_completion_task() returned 0 but have to.
>
> Examples please. I'm not aware of any such cases.
>
> Cheers
> Trond
>
You are right. I was confused with different logic for NSFv4, NLM and N=
=46Sv3.
Drop the patch.
Sorry.
--=20
Best regards,
Stanislav Kinsbursky
^ permalink raw reply [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).