All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: <stable@vger.kernel.org>
Cc: Greg KH <greg@kroah.com>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	open-osd <osd-dev@open-osd.org>,
	NFS list <linux-nfs@vger.kernel.org>
Subject: Re: Patch Upstream: pnfs-obj: pNFS errors are communicated on iodata->pnfs_error
Date: Wed, 18 Jan 2012 23:53:25 +0200	[thread overview]
Message-ID: <4F173F55.4090509@panasas.com> (raw)
In-Reply-To: <20120112231355.GA20151@kroah.com>

On 01/13/2012 01:13 AM, Greg KH wrote:
> 
> Care to provide me such a patch for 3.0?
> 
> thanks,
> 
> greg k-h

Hi this is a 3.1 and 3.0 version of this patch. It is based on todays
stable tree checkout. It will apply cleanly to both linux-3.0.y and
linux-3.1.y branches.

Thanks
Boaz
---
From: Boaz Harrosh <bharrosh@panasas.com>
Subject: pnfs-obj: pNFS errors are communicated on iodata->pnfs_error (linux-3.0.y)

Some time along the way pNFS IO errors were switched to
communicate with a special iodata->pnfs_error member instead
of the regular RPC members. But objlayout was not switched
over.

Fix that!
Without this fix any IO error is hanged, because IO is not
switched to MDS and pages are never cleared or read.

[This is the 3.0.y and 3.1.y equal of mainline [5c0b412] patch]
CC: Stable Tree <stable@kernel.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfs/objlayout/objlayout.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/objlayout/objlayout.c b/fs/nfs/objlayout/objlayout.c
index 1d06f8e..fefa122 100644
--- a/fs/nfs/objlayout/objlayout.c
+++ b/fs/nfs/objlayout/objlayout.c
@@ -294,9 +294,11 @@ objlayout_read_done(struct objlayout_io_state *state, ssize_t status, bool sync)
 	dprintk("%s: Begin status=%zd eof=%d\n", __func__, status, eof);
 	rdata = state->rpcdata;
 	rdata->task.tk_status = status;
-	if (status >= 0) {
+	if (likely(status >= 0)) {
 		rdata->res.count = status;
 		rdata->res.eof = eof;
+	} else {
+		rdata->pnfs_error = status;
 	}
 	objlayout_iodone(state);
 	/* must not use state after this point */
@@ -380,15 +382,17 @@ objlayout_write_done(struct objlayout_io_state *state, ssize_t status,
 	wdata = state->rpcdata;
 	state->status = status;
 	wdata->task.tk_status = status;
-	if (status >= 0) {
+	if (likely(status >= 0)) {
 		wdata->res.count = status;
 		wdata->verf.committed = state->committed;
 		dprintk("%s: Return status %d committed %d\n",
 			__func__, wdata->task.tk_status,
 			wdata->verf.committed);
-	} else
+	} else {
+		wdata->pnfs_error = status;
 		dprintk("%s: Return status %d\n",
 			__func__, wdata->task.tk_status);
+	}
 	objlayout_iodone(state);
 	/* must not use state after this point */
 
-- 
1.7.2.3


       reply	other threads:[~2012-01-18 21:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120111154700.61EA4262C@git.kroah.org>
     [not found] ` <20120112231355.GA20151@kroah.com>
2012-01-18 21:53   ` Boaz Harrosh [this message]
2012-01-22 21:10     ` Patch Upstream: pnfs-obj: pNFS errors are communicated on iodata->pnfs_error Greg KH

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=4F173F55.4090509@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=greg@kroah.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=osd-dev@open-osd.org \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.