All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 2/3] pnfs: mark page with error in readpage_async_filler when crossing lsegs
Date: Wed, 27 Oct 2010 20:24:13 +0200	[thread overview]
Message-ID: <1288203853-26883-1-git-send-email-bhalevy@panasas.com> (raw)
In-Reply-To: <4CC86D96.8020803@panasas.com>

From: Benny Halevy <bhalevy@compute-1-5.palab.panasas.com>

Signed-off-by: Benny Halevy <bhalevy@compute-1-5.palab.panasas.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
 fs/nfs/read.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index e1e1a65..1df536a 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -605,24 +605,24 @@ readpage_async_filler(void *data, struct page *page)
 {
 	struct nfs_readdesc *desc = (struct nfs_readdesc *)data;
 	struct inode *inode = page->mapping->host;
-	struct pnfs_layout_range *range;
 	struct nfs_page *new;
 	unsigned int len;
-	loff_t pgoff;
 	int error;
 
 	len = nfs_page_length(page);
 	if (len == 0)
 		return nfs_return_empty_page(page);
 
-	pgoff = (loff_t)page->index << PAGE_CACHE_SHIFT;
-	range = desc->pgio->pg_lseg ? &desc->pgio->pg_lseg->range : NULL;
-	if (!range ||
-	    (range->offset > pgoff + len) ||
-	    (range->offset + range->length < pgoff)) {
-		put_lseg(desc->pgio->pg_lseg);
-		desc->pgio->pg_lseg = pnfs_update_layout(inode, desc->ctx,
-			pgoff, len, IOMODE_READ);
+	if (desc->pgio->pg_lseg) {
+		loff_t pgoff = (loff_t)page->index << PAGE_CACHE_SHIFT;
+		struct pnfs_layout_range *range = &desc->pgio->pg_lseg->range;
+
+		/* retry later with the right lseg? */
+		if (range->offset > pgoff + len ||
+		    range->offset + range->length < pgoff) {
+			new = ERR_PTR(-EAGAIN);
+			goto out_error;
+		}
 	}
 
 	new = nfs_create_request(desc->ctx, inode, page, 0, len,
-- 
1.7.2.3


  parent reply	other threads:[~2010-10-27 18:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 18:21 [PATCH 1/4] pnfs fixes Benny Halevy
2010-10-27 18:22 ` [PATCH 1/1] SQUASHME: pnfsd-files: update layout stateid properly Benny Halevy
2010-10-27 18:23 ` [PATCH 1/1] pnfs: do not change layout stateid when dropping layouts Benny Halevy
2010-10-27 18:24 ` Benny Halevy [this message]
2010-10-27 18:24 ` [PATCH 3/3] SQUASHME: pnfs: filelayout: print_ds should use dprintk Benny Halevy
2010-10-27 19:49   ` Fred Isaman
2010-10-27 20:06     ` Benny Halevy
2010-10-27 20:17       ` Fred Isaman
2010-10-27 21:00         ` Benny Halevy
2010-10-27 21:23           ` Trond Myklebust
2010-10-27 21:29             ` Benny Halevy
2010-10-27 21:32               ` Trond Myklebust
2010-10-27 21:42                 ` Benny Halevy
2010-10-28 13:11                   ` Benny Halevy

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=1288203853-26883-1-git-send-email-bhalevy@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=linux-nfs@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.