[pnfs-submit-wave3,update,2/5] wave3: clean up nfs4_reset_read to match write
diff mbox

Message ID 1299007534-4105-3-git-send-email-andros@netapp.com
State RFC, archived
Headers show

Commit Message

Andy Adamson March 1, 2011, 7:25 p.m. UTC
None

Patch
diff mbox

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index c26b655..45b650a 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -142,8 +142,8 @@  static int filelayout_read_done_cb(struct rpc_task *task,
 		dprintk("%s calling restart ds_clp %p ds_clp->cl_session %p\n",
 			__func__, data->ds_clp, data->ds_clp->cl_session);
 		if (reset) {
-			nfs4_reset_read(task, data);
 			filelayout_set_lo_fail(data->lseg);
+			nfs4_reset_read(task, data);
 			clp = NFS_SERVER(data->inode)->nfs_client;
 		}
 		nfs_restart_rpc(task, clp);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index a54d8e6..5742a5e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3112,6 +3112,8 @@  static void nfs4_proc_read_setup(struct nfs_read_data *data, struct rpc_message
 void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data)
 {
 	dprintk("%s Reset task for i/o through\n", __func__);
+	put_lseg(data->lseg);
+	data->lseg = NULL;
 	/* offsets will differ in the dense stripe case */
 	data->args.offset = data->mds_offset;
 	data->ds_clp = NULL;