[pnfs] [PATCH 14/21] pnfsblock: read path error handling

Fred Isaman iisaman at citi.umich.edu
Thu Apr 10 10:07:30 EDT 2008


Make sure we fall back to nfs if had previous pnfs failure.

Signed-off-by: Fred Isaman <iisaman at citi.umich.edu>
---
 fs/nfs/blocklayout/blocklayout.c |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index e88577d..6d8a897 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -197,6 +197,15 @@ static void bl_end_read_bio(struct bio *bio, int err)
 	struct nfs_read_data *data = (struct nfs_read_data *)bio->bi_private;
 
 	dprintk("%s called with err=%i\n", __func__, err);
+	if (err) {
+		struct page **pp;
+		int i = 0;
+		/* XXX Is this correct??? What if short read? */
+		for (pp = data->pagevec; i < data->npages; i++, pp++) {
+			SetPageError(*pp);
+			SetPagePnfsErr(*pp);
+		}
+	}
 	bl_readlist_done(data, err);
 	bio_put(bio);
 }
@@ -231,6 +240,13 @@ bl_read_pagelist(struct pnfs_layout_type *layoutid,
 		dprintk("%s dont_like_caller failed\n", __func__);
 		goto use_mds;
 	}
+	/* NOTE This error passing could be put in layout,
+	 * though then pg_test can't easily get.
+	 */
+	if (PagePnfsErr(rdata->req->wb_page)) {
+		dprintk("%s PG_pnfserr set\n", __func__);
+		goto use_mds;
+	}
 	isect = (sector_t) (f_offset >> 9);
 	be = find_get_extent(rdata->lseg, isect, &cow_read);
 	if (!be || count > (be->be_length << 9)) {
@@ -552,7 +568,12 @@ bl_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
 	   struct nfs_page *req)
 {
 	dprintk("%s enter\n", __func__);
-	return 1;
+	if (pgio->pg_iswrite) {
+		/* Stub */
+		return 1;
+	} else {
+		return !PagePnfsErr(req->wb_page);
+	}
 }
 
 static struct layoutdriver_io_operations blocklayout_io_operations = {
-- 
1.5.3.3



More information about the pNFS mailing list