[pnfs] [PATCH 14/20] 2.6-latest pnfs client propagate pnfs_try_to_read error
andros at umich.edu
andros at umich.edu
Wed Nov 28 16:33:15 EST 2007
From: Andy Adamson <andros at umich.edu>
Allow pnfs_try_to_read() to return an error on I/O. This
error is propagated through nfs_read_rpcsetup() to the application.
This behaviour will disappear when prototypes can all perform I/O through
the MDS.
Signed-off by: Andy Adamson<andros at umich.edu>
---
fs/nfs/read.c | 10 +++++++++-
include/linux/nfs_xdr.h | 1 +
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 67caf23..4cf47c5 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -224,7 +224,7 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
nfs_fattr_init(&data->fattr);
#ifdef CONFIG_PNFS
- if ((pnfs_try_to_read_data(data, call_ops)) <= 0)
+ if ((data->error = pnfs_try_to_read_data(data, call_ops)) <= 0)
return;
#endif /* CONFIG_PNFS*/
@@ -297,6 +297,10 @@ static int nfs_pagein_multi(struct inode *inode, struct list_head *head, unsigne
rsize = nbytes;
nfs_read_rpcsetup(req, data, &nfs_read_partial_ops,
rsize, offset);
+#ifdef CONFIG_PNFS
+ if (data->error < 0)
+ return data->error;
+#endif /* CONFIG_PNFS */
offset += rsize;
nbytes -= rsize;
} while (nbytes != 0);
@@ -337,6 +341,10 @@ static int nfs_pagein_one(struct inode *inode, struct list_head *head, unsigned
req = nfs_list_entry(data->pages.next);
nfs_read_rpcsetup(req, data, &nfs_read_full_ops, count, 0);
+#ifdef CONFIG_PNFS
+ if (data->error < 0)
+ return data->error;
+#endif /* CONFIG_PNFS */
return 0;
out_bad:
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 84c87dc..36b719c 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1061,6 +1061,7 @@ struct nfs_read_data {
__u64 orig_offset;
int how; /* for FLUSH_STABLE */
struct nfs_client * ds_nfs_client; /* XXX Do await w/o it? */
+ int error; /* propagate pNFS read error */
#endif
struct page *page_array[NFS_PAGEVEC_SIZE];
};
--
1.5.0.2
More information about the pNFS
mailing list