mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stanislav Kinsbursky <skinsbursky@parallels.com>
To: Trond.Myklebust@netapp.com
Cc: linux-nfs@vger.kernel.org, xemul@parallels.com, neilb@suse.de,
	linux-kernel@vger.kernel.org, bfields@fieldses.org,
	skinsbursky@openvz.org
Subject: [PATCH] RPC: return task->tk_status from rpc_wait_for_completion_task() in case of successfull task completion
Date: Tue, 15 Mar 2011 17:20:36 +0300	[thread overview]
Message-ID: <20110315141951.16564.72417.stgit@localhost6.localdomain6> (raw)

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)


             reply	other threads:[~2011-03-15 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15 14:20 Stanislav Kinsbursky [this message]
2011-03-15 14:26 ` Trond Myklebust
2011-03-15 17:36   ` Stanislav Kinsbursky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110315141951.16564.72417.stgit@localhost6.localdomain6 \
    --to=skinsbursky@parallels.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=skinsbursky@openvz.org \
    --cc=xemul@parallels.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®