[pnfs] [PATCH 2/2] pnfs: Explicitly set error return in file layout

Dean Hildebrand seattleplus at gmail.com
Mon May 12 14:35:17 EDT 2008


Set pnfserror in file layout write and
read pagelist and fix up some return
comments.

Signed-off-by: Dean Hildebrand <dhildeb at us.ibm.com>
---
 fs/nfs/nfs4filelayout.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 020949f..1932928 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -292,6 +292,8 @@ static int filelayout_read_pagelist(
 		/* Now get the file offset on the dserver
 		 * Set the read offset to this offset, and
 		 * save the original offset in orig_offset
+		 * In the case of aync reads, the offset will be reset in the
+		 * call_ops->rpc_call_done() routine.
 		 */
 		data->args.offset = filelayout_get_dserver_offset(offset,
 								  flseg);
@@ -301,10 +303,7 @@ static int filelayout_read_pagelist(
 	/* Perform an asynchronous read */
 	nfs_initiate_read(data, data->pnfs_client, &filelayout_read_call_ops);
 
-	/* In the case of aync reads, the offset will be reset in the
-	 * call_ops->rpc_call_done() routine.
-	 */
-	status = 0;
+	data->pnfs_error = 0;
 
 	return status;
 }
@@ -378,6 +377,7 @@ static int filelayout_write_pagelist(
 	nfs_initiate_write(data, data->pnfs_client,
 			   &filelayout_write_call_ops, sync);
 
+	data->pnfs_error = 0;
 	return 0;
 }
 
-- 
1.5.3.3



More information about the pNFS mailing list