RPC: return task->tk_status from rpc_wait_for_completion_task() in case of successfull task completion
Subsystems (2)
PATCH 1/1 RPC: return task->tk_status from rpc_wait_for_completion_task() in case of successfull task completion
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
--- include/linux/sunrpc/sched.h | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
include/linux/sunrpc/sched.h +6 -1
@@ -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)
Quoted 2 lines · Stanislav Kinsbursky
Some NFS and NLM routines doesn't check RPC task
tk_statusifrpc_wait_for_completion_task()returned 0 but have to.
Examples please. I'm not aware of any such cases.
Cheers
Trond
Signature · 6 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com
15.03.2011 17:26, Trond Myklebust =D0=BF=D0=B8=D1=88=D0=B5=D1=82:
Quoted 9 lines · Stanislav Kinsbursky
Quoted 2 lines
Some NFS and NLM routines doesn't check RPC task
tk_statusifrpc_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