[PATCH] RPC: return task->tk_status from rpc_wait_for_completion_task() in case of successfull task completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>

---
 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)

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux