All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] pnfs_submit: Restore forgetful mode io draining
@ 2010-10-07  9:35 Fred Isaman
  2010-10-12 18:04 ` Benny Halevy
  0 siblings, 1 reply; 3+ messages in thread
From: Fred Isaman @ 2010-10-07  9:35 UTC (permalink / raw)
  To: linux-nfs

Recent changes to the waitq code removed the wait for io to drain
in the case of a "forgetful" return.  Restore the previous behavior.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/nfs4proc.c       |    6 +++++-
 fs/nfs/pnfs.c           |    9 +++------
 include/linux/nfs_xdr.h |    1 +
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index c854814..7727f592 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5639,7 +5639,11 @@ nfs4_layoutreturn_prepare(struct rpc_task *task, void *calldata)
 		rpc_sleep_on(&nfsi->lo_rpcwaitq, task, NULL);
 		return;
 	}
-
+	if (lrp->stateid) {
+		/* Forget the layout, without sending the return */
+		rpc_exit(task, 0);
+		return;
+	}
 	if (nfs4_setup_sequence(server, NULL, &lrp->args.seq_args,
 				&lrp->res.seq_res, 0, task))
 		return;
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index f573219..eb4dfdf 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -612,7 +612,7 @@ pnfs_return_layout_barrier(struct nfs_inode *nfsi,
 static int
 return_layout(struct inode *ino, struct pnfs_layout_range *range,
 	      enum pnfs_layoutreturn_type type, struct pnfs_layout_hdr *lo,
-	      bool wait)
+	      bool wait, const nfs4_stateid *stateid)
 {
 	struct nfs4_layoutreturn *lrp;
 	struct nfs_server *server = NFS_SERVER(ino);
@@ -633,6 +633,7 @@ return_layout(struct inode *ino, struct pnfs_layout_range *range,
 	lrp->args.return_type = type;
 	lrp->args.range = *range;
 	lrp->args.inode = ino;
+	lrp->stateid = stateid;
 
 	status = nfs4_proc_layoutreturn(lrp, wait);
 out:
@@ -688,11 +689,7 @@ _pnfs_return_layout(struct inode *ino, struct pnfs_layout_range *range,
 					__func__, status);
 			}
 		}
-
-		if (!stateid)
-			status = return_layout(ino, &arg, type, lo, wait);
-		else
-			pnfs_layoutreturn_release(lo, &arg);
+		status = return_layout(ino, &arg, type, lo, wait, stateid);
 	}
 out:
 	dprintk("<-- %s status: %d\n", __func__, status);
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index c72de21..80e6a36 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -277,6 +277,7 @@ struct nfs4_layoutreturn {
 	struct nfs4_layoutreturn_args args;
 	struct nfs4_layoutreturn_res res;
 	struct rpc_cred *cred;
+	const nfs4_stateid *stateid;
 	int rpc_status;
 };
 
-- 
1.7.2.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-12 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-07  9:35 [PATCH 1/1] pnfs_submit: Restore forgetful mode io draining Fred Isaman
2010-10-12 18:04 ` Benny Halevy
2010-10-12 18:48   ` Fred Isaman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.