From: Benny Halevy <bhalevy@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx> --- 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 -- 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