[pnfs] [PATCH 02/25] pnfs: fix pnfs4_*_done routines

Fred Isaman iisaman at citi.umich.edu
Thu Feb 14 13:21:20 EST 2008


The pnfs4_*_done routines are ignoring the possibility that the code
fell back to nfs.  This patch chops out layoutcommit setup that is done
there (incorrectly in the fallback case) which is already done by
pnfs_writepages anyway.

TO CHECK: pnfs4_read_done does not do a nfs_invalidate_atime that
nfs4_read_done does.  Does it need to be done in the fallback case?
In that case, do we need to add a flag to data->pnfsflags?

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

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index eaaaeed..87c7451 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3039,6 +3039,10 @@ static int pnfs4_read_done(struct rpc_task *task, struct nfs_read_data *data)
 		return -EAGAIN;
 	}
 
+	/* FRED - if we fell back to nfs, do we need to call
+	 * nfs_invalidate_atime(data->inode) ?
+	 */
+
 	/* Only renew lease if this was a read call to MDS */
 	if (task->tk_status > 0 && !data->ds_nfs_client)
 		renew_lease(mds_svr, data->timestamp);
@@ -3083,15 +3087,10 @@ static int pnfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
 	 * MDS write: renew lease
 	 * DS write: update lastbyte written
 	 */
-	if (task->tk_status > 0) {
-		if (!data->ds_nfs_client) {
-			nfs_post_op_update_inode_force_wcc(data->inode,
-							data->res.fattr);
-			renew_lease(mds_svr, data->timestamp);
-		} else
-			pnfs_update_last_write(NFS_I(data->inode),
-					       data->args.offset,
-					       data->res.count);
+	if (task->tk_status > 0 && !data->ds_nfs_client) {
+		nfs_post_op_update_inode_force_wcc(data->inode,
+						   data->res.fattr);
+		renew_lease(mds_svr, data->timestamp);
 	}
 	return 0;
 }
@@ -3125,13 +3124,10 @@ static int pnfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data)
 		return -EAGAIN;
 	}
 
-	if (task->tk_status >= 0) {
+	if (task->tk_status >= 0 && !data->ds_nfs_client) {
 		/* Update inode if commit to MDS */
 		if (!data->ds_nfs_client)
 			nfs_refresh_inode(data->inode, data->res.fattr);
-
-		/* Mark for LAYOUTCOMMIT */
-		pnfs_need_layoutcommit(NFS_I(data->inode), data->args.context);
 	}
 	dprintk("<-- %s\n", __func__);
 	return 0;
-- 
1.5.3.3



More information about the pNFS mailing list