[pnfs] [PATCH 07/14] pnfs: allow io error to propagate up.

Fred Isaman iisaman at citi.umich.edu
Tue Mar 25 16:24:19 EDT 2008


This allows the panlayout driver to propagate error codes up as before.

Signed-off-by: Fred Isaman <iisaman at citi.umich.edu>
---
 fs/nfs/read.c           |    4 ++--
 fs/nfs/write.c          |    4 ++--
 include/linux/nfs_xdr.h |    2 ++
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 22f6bd8..c8a5d47 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -226,8 +226,8 @@ static int nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
 
 #ifdef CONFIG_PNFS
 	ret = pnfs_try_to_read_data(data, call_ops);
-	if (ret <= 0)
-		return ret;
+	if (ret == 0)
+		return data->pnfs_error;
 #endif /* CONFIG_PNFS*/
 
 	nfs_initiate_read(data, NFS_CLIENT(inode), call_ops);
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index d5baacd..f58facf 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -806,8 +806,8 @@ static int nfs_write_rpcsetup(struct nfs_page *req,
 
 #ifdef CONFIG_PNFS
 	ret = pnfs_try_to_write_data(data, call_ops, how);
-	if (ret <= 0)
-		return ret;
+	if (ret == 0)
+		return data->pnfs_error;
 #endif /* CONFIG_PNFS */
 
 	nfs_initiate_write(data, NFS_CLIENT(inode), call_ops, how);
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index d991743..285db54 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1047,6 +1047,7 @@ struct nfs_read_data {
 	const struct rpc_call_ops *call_ops;
 	struct rpc_clnt		*pnfs_client;	/* Holds pNFS device across async calls */
 	int			pnfsflags;
+	int			pnfs_error;
 	__u64			orig_offset;
 	struct nfs_client	*ds_nfs_client;
 #endif /* CONFIG_PNFS */
@@ -1081,6 +1082,7 @@ struct nfs_write_data {
 	struct rpc_clnt		*pnfs_client;	/* Holds pNFS device across
 						   async calls */
 	int			pnfsflags;
+	int			pnfs_error;
 	__u64			orig_offset;
 	int			how;		/* for FLUSH_STABLE */
 	struct nfs_client	*ds_nfs_client;
-- 
1.5.3.3



More information about the pNFS mailing list