All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4]: Fix EAGAIN handling for the filelayout
@ 2010-06-13 20:18 Fred Isaman
  2010-06-13 20:18 ` [PATCH 1/4] pnfs-submit: filelayout: Stop using pnfs_call_done and friends Fred Isaman
  2010-06-15  0:08 ` [PATCH 0/4]: Fix EAGAIN handling for the filelayout Benny Halevy
  0 siblings, 2 replies; 6+ messages in thread
From: Fred Isaman @ 2010-06-13 20:18 UTC (permalink / raw)
  To: linux-nfs

These patches remove pnfs_call_done and all the routines associated with it.
They were quite buggy for filelayout, and tended to crash the client anytime
EAGAIN handling was invoked (in particular on short reads.)

The first patch just has filelayout avoid using them entirely. It should NOT
be reverted in the post-submit.

The subsequent patches remove the unused code for pnfs-submit. It is
expected they will be reverted in the post-submit.

Fred


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

* [PATCH 1/4] pnfs-submit: filelayout: Stop using pnfs_call_done and friends
  2010-06-13 20:18 [PATCH 0/4]: Fix EAGAIN handling for the filelayout Fred Isaman
@ 2010-06-13 20:18 ` Fred Isaman
  2010-06-13 20:18   ` [PATCH 2/4] pnfs-submit: Remove checks for non-rpc drivers Fred Isaman
  2010-06-15  0:08 ` [PATCH 0/4]: Fix EAGAIN handling for the filelayout Benny Halevy
  1 sibling, 1 reply; 6+ messages in thread
From: Fred Isaman @ 2010-06-13 20:18 UTC (permalink / raw)
  To: linux-nfs

The current handling is quite flawed.  The rpc_call_done function
can restart the rpc, so doing anything after the call doesn't work.

In particular:
The current code often ends trying to resend the rpc twice.
The lseg_put should be in the release call, not the done call.
There is no way to distinguish whether a retry should be through the DS or MDS
If rpc_run_task returns an error, rpc_call_done won't even be called.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/nfs4filelayout.c |   30 +++++++++++++++++++++++++++---
 fs/nfs/pnfs.c           |    1 +
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index e6d45b8..472b613 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -54,6 +54,7 @@
 #include "nfs4filelayout.h"
 #include "nfs4_fs.h"
 #include "internal.h"
+#include "pnfs.h"
 
 #define NFSDBG_FACILITY         NFSDBG_PNFS_LD
 
@@ -151,7 +152,17 @@ static void filelayout_read_call_done(struct rpc_task *task, void *data)
 		rdata->args.offset = rdata->fldata.orig_offset;
 	}
 
-	pnfs_callback_ops->nfs_readlist_complete(rdata);
+	/* Note this may cause RPC to be resent */
+	rdata->pdata.call_ops->rpc_call_done(task, data);
+}
+
+static void filelayout_read_release(void *data)
+{
+	struct nfs_read_data *rdata = (struct nfs_read_data *)data;
+
+	put_lseg(rdata->pdata.lseg);
+	rdata->pdata.lseg = NULL;
+	rdata->pdata.call_ops->rpc_release(data);
 }
 
 static void filelayout_write_call_done(struct rpc_task *task, void *data)
@@ -164,17 +175,29 @@ static void filelayout_write_call_done(struct rpc_task *task, void *data)
 		wdata->args.offset = wdata->fldata.orig_offset;
 	}
 
-	pnfs_callback_ops->nfs_writelist_complete(wdata);
+	/* Note this may cause RPC to be resent */
+	wdata->pdata.call_ops->rpc_call_done(task, data);
+}
+
+static void filelayout_write_release(void *data)
+{
+	struct nfs_write_data *wdata = (struct nfs_write_data *)data;
+
+	put_lseg(wdata->pdata.lseg);
+	wdata->pdata.lseg = NULL;
+	wdata->pdata.call_ops->rpc_release(data);
 }
 
 struct rpc_call_ops filelayout_read_call_ops = {
 	.rpc_call_prepare = nfs_read_prepare,
 	.rpc_call_done = filelayout_read_call_done,
+	.rpc_release = filelayout_read_release,
 };
 
 struct rpc_call_ops filelayout_write_call_ops = {
 	.rpc_call_prepare = nfs_write_prepare,
 	.rpc_call_done = filelayout_write_call_done,
+	.rpc_release = filelayout_write_release,
 };
 
 /* Perform sync or async reads.
@@ -539,12 +562,13 @@ static void filelayout_commit_call_done(struct rpc_task *task, void *data)
 {
 	struct nfs_write_data *wdata = (struct nfs_write_data *)data;
 
-	pnfs_callback_ops->nfs_commit_complete(wdata);
+	wdata->pdata.call_ops->rpc_call_done(task, data);
 }
 
 static struct rpc_call_ops filelayout_commit_call_ops = {
 	.rpc_call_prepare = nfs_write_prepare,
 	.rpc_call_done = filelayout_commit_call_done,
+	.rpc_release = filelayout_write_release,
 };
 
 /*
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 7d322c9..a4d1937 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -452,6 +452,7 @@ put_lseg(struct pnfs_layout_segment *lseg)
 	if (do_wake_up)
 		wake_up(&nfsi->lo_waitq);
 }
+EXPORT_SYMBOL(put_lseg);
 
 static inline u64
 end_offset(u64 start, u64 len)
-- 
1.6.6.1


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

* [PATCH 2/4] pnfs-submit: Remove checks for non-rpc drivers
  2010-06-13 20:18 ` [PATCH 1/4] pnfs-submit: filelayout: Stop using pnfs_call_done and friends Fred Isaman
@ 2010-06-13 20:18   ` Fred Isaman
  2010-06-13 20:18     ` [PATCH 3/4] pnfs-submit: Remove pnfs_call_done and friends Fred Isaman
  0 siblings, 1 reply; 6+ messages in thread
From: Fred Isaman @ 2010-06-13 20:18 UTC (permalink / raw)
  To: linux-nfs

Removes PNFS_NO_RPC and pnfs_use_rpc()

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

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 472b613..9a3ea49 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -753,7 +753,6 @@ struct layoutdriver_io_operations filelayout_io_operations = {
 };
 
 struct layoutdriver_policy_operations filelayout_policy_operations = {
-	.flags                 = PNFS_USE_RPC_CODE,
 	.get_stripesize        = filelayout_get_stripesize,
 	.pg_test               = filelayout_pg_test,
 };
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 192afc3..c7d68f5 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3175,9 +3175,6 @@ static int pnfs4_read_done(struct rpc_task *task, struct nfs_read_data *data)
 
 	dprintk("--> %s\n", __func__);
 
-	if (data->pdata.pnfsflags & PNFS_NO_RPC)
-		return 0;
-
 	status = task->tk_status >= 0 ? 0 : task->tk_status;
 
 	/* Is this a DS session */
@@ -3225,9 +3222,6 @@ static int pnfs4_write_done(struct rpc_task *task, struct nfs_write_data *data)
 		data->args.count = data->pdata.orig_count;
 	}
 
-	if (data->pdata.pnfsflags & PNFS_NO_RPC)
-		return 0;
-
 	/* Is this a DS session */
 	if (data->fldata.ds_nfs_client) {
 		dprintk("%s DS write\n", __func__);
@@ -3278,9 +3272,6 @@ static int pnfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data)
 
 	dprintk("--> %s task->tk_status %d\n", __func__, task->tk_status);
 
-	if (data->pdata.pnfsflags & PNFS_NO_RPC)
-		return 0;
-
 	/* Is this a DS session */
 	if (data->fldata.ds_nfs_client) {
 		dprintk("%s DS commit\n", __func__);
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index a4d1937..89c788d 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1406,24 +1406,16 @@ pnfs_call_done(struct pnfs_call_data *pdata, struct rpc_task *task, void *data)
 	pdata->call_ops->rpc_call_done(task, data);
 	if (pdata->pnfs_error == -EAGAIN || task->tk_status == -EAGAIN)
 		return -EAGAIN;
-	if (pdata->pnfsflags & PNFS_NO_RPC) {
-		pdata->call_ops->rpc_release(data);
-	} else {
-		/*
-		 * just restore original rpc call ops
-		 * rpc_release will be called later by the rpc scheduling layer.
-		 */
-		task->tk_ops = pdata->call_ops;
-	}
+	/*
+	 * just restore original rpc call ops
+	 * rpc_release will be called later by the rpc scheduling layer.
+	 */
+	task->tk_ops = pdata->call_ops;
 	return 0;
 }
 
 /* Post-write completion function
  * Invoked by all layout drivers when write_pagelist is done.
- *
- * NOTE: callers set data->pnfsflags PNFS_NO_RPC
- * so that the NFS cleanup routines perform only the page cache
- * cleanup.
  */
 static void
 pnfs_write_retry(struct work_struct *work)
@@ -1450,18 +1442,6 @@ pnfs_writeback_done(struct nfs_write_data *data)
 
 	dprintk("%s: Begin (status %d)\n", __func__, data->task.tk_status);
 
-	/* update last write offset and need layout commit
-	 * for non-files layout types (files layout calls
-	 * pnfs4_write_done for this)
-	 */
-	if ((pdata->pnfsflags & PNFS_NO_RPC) &&
-	    data->task.tk_status >= 0 && data->res.count > 0) {
-		struct nfs_inode *nfsi = NFS_I(data->inode);
-
-		pnfs_update_last_write(nfsi, data->args.offset, data->res.count);
-		pnfs_need_layoutcommit(nfsi, data->args.context);
-	}
-
 	if (pnfs_call_done(pdata, &data->task, data) == -EAGAIN) {
 		INIT_WORK(&data->task.u.tk_work, pnfs_write_retry);
 		queue_work(nfsiod_workqueue, &data->task.u.tk_work);
@@ -1507,8 +1487,6 @@ pnfs_writepages(struct nfs_write_data *wdata, int how)
 		__func__,
 		how,
 		numpages);
-	if (!pnfs_use_rpc(nfss))
-		wdata->pdata.pnfsflags |= PNFS_NO_RPC;
 	wdata->pdata.lseg = lseg;
 	trypnfs = nfss->pnfs_curr_ld->ld_io_ops->write_pagelist(
 							&nfsi->layout,
@@ -1521,7 +1499,6 @@ pnfs_writepages(struct nfs_write_data *wdata, int how)
 							wdata);
 
 	if (trypnfs == PNFS_NOT_ATTEMPTED) {
-		wdata->pdata.pnfsflags &= ~PNFS_NO_RPC;
 		wdata->pdata.lseg = NULL;
 		put_lseg(lseg);
 	}
@@ -1597,8 +1574,6 @@ pnfs_readpages(struct nfs_read_data *rdata)
 
 	dprintk("%s: Calling layout driver read with %d pages\n",
 		__func__, numpages);
-	if (!pnfs_use_rpc(nfss))
-		rdata->pdata.pnfsflags |= PNFS_NO_RPC;
 	rdata->pdata.lseg = lseg;
 	trypnfs = nfss->pnfs_curr_ld->ld_io_ops->read_pagelist(
 							&nfsi->layout,
@@ -1609,7 +1584,6 @@ pnfs_readpages(struct nfs_read_data *rdata)
 							args->count,
 							rdata);
 	if (trypnfs == PNFS_NOT_ATTEMPTED) {
-		rdata->pdata.pnfsflags &= ~PNFS_NO_RPC;
 		rdata->pdata.lseg = NULL;
 		put_lseg(lseg);
 	}
@@ -1688,12 +1662,8 @@ pnfs_commit(struct nfs_write_data *data, int sync)
 	 * This will be done by passing the buck to the layout driver.
 	 */
 	data->pdata.lseg = NULL;
-	if (!pnfs_use_rpc(nfss))
-		data->pdata.pnfsflags |= PNFS_NO_RPC;
 	trypnfs = nfss->pnfs_curr_ld->ld_io_ops->commit(&nfsi->layout,
 							sync, data);
-	if (trypnfs == PNFS_NOT_ATTEMPTED)
-		data->pdata.pnfsflags &= ~PNFS_NO_RPC;
 	dprintk("%s End (trypnfs:%d)\n", __func__, trypnfs);
 	return trypnfs;
 }
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 75f6cf1..60bddc1 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -195,14 +195,6 @@ static inline int pnfs_get_read_status(struct nfs_read_data *data)
 	return data->pdata.pnfs_error;
 }
 
-static inline int pnfs_use_rpc(struct nfs_server *nfss)
-{
-	if (pnfs_enabled_sb(nfss))
-		return pnfs_ld_use_rpc_code(nfss->pnfs_curr_ld);
-
-	return 1;
-}
-
 #else  /* CONFIG_NFS_V4_1 */
 
 static inline void get_lseg(struct pnfs_layout_segment *lseg)
@@ -253,11 +245,6 @@ static inline int pnfs_get_read_status(struct nfs_read_data *data)
 	return 0;
 }
 
-static inline int pnfs_use_rpc(struct nfs_server *nfss)
-{
-	return 1;
-}
-
 static inline int pnfs_layoutcommit_inode(struct inode *inode, int sync)
 {
 	return 0;
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index f6e97c8..a987d06 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -173,9 +173,6 @@ struct layoutdriver_io_operations {
 };
 
 enum layoutdriver_policy_flags {
-	/* Should the full nfs rpc cleanup code be used after io */
-	PNFS_USE_RPC_CODE		= 1 << 0,
-
 	/* Should the NFS req. gather algorithm cross stripe boundaries? */
 	PNFS_GATHER_ACROSS_STRIPES	= 1 << 1,
 
@@ -193,13 +190,6 @@ struct layoutdriver_policy_operations {
 	int (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
 };
 
-/* Should the full nfs rpc cleanup code be used after io */
-static inline int
-pnfs_ld_use_rpc_code(struct pnfs_layoutdriver_type *ld)
-{
-	return ld->ld_policy_ops->flags & PNFS_USE_RPC_CODE;
-}
-
 /* Should the NFS req. gather algorithm cross stripe boundaries? */
 static inline int
 pnfs_ld_gather_across_stripes(struct pnfs_layoutdriver_type *ld)
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 22113a1..aa41a3c 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -967,8 +967,6 @@ struct nfs_page;
 #define NFS_PAGEVEC_SIZE	(8U)
 
 #if defined(CONFIG_NFS_V4_1)
-/* pnfsflag values */
-#define PNFS_NO_RPC		0x0001   /* non rpc result callback switch */
 
 /* pnfs-specific data needed for read, write, and commit calls */
 struct pnfs_call_data {
@@ -976,7 +974,6 @@ struct pnfs_call_data {
 	const struct rpc_call_ops *call_ops;
 	u32			orig_count;	/* for retry via MDS */
 	int			pnfs_error;
-	u8			pnfsflags;
 	u8			how;		/* for FLUSH_STABLE */
 };
 
-- 
1.6.6.1


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

* [PATCH 3/4] pnfs-submit: Remove pnfs_call_done and friends
  2010-06-13 20:18   ` [PATCH 2/4] pnfs-submit: Remove checks for non-rpc drivers Fred Isaman
@ 2010-06-13 20:18     ` Fred Isaman
  2010-06-13 20:18       ` [PATCH 4/4] pnfs-submit: Remove pnfs_error Fred Isaman
  0 siblings, 1 reply; 6+ messages in thread
From: Fred Isaman @ 2010-06-13 20:18 UTC (permalink / raw)
  To: linux-nfs

Filelayout isn't using it, so rip it all out.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/pnfs.c             |  109 ---------------------------------------------
 include/linux/nfs4_pnfs.h |    9 ----
 2 files changed, 0 insertions(+), 118 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 89c788d..7795e3e 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1398,56 +1398,6 @@ pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *inode)
 	pnfs_set_pg_test(inode, pgio);
 }
 
-static int
-pnfs_call_done(struct pnfs_call_data *pdata, struct rpc_task *task, void *data)
-{
-	put_lseg(pdata->lseg);
-	pdata->lseg = NULL;
-	pdata->call_ops->rpc_call_done(task, data);
-	if (pdata->pnfs_error == -EAGAIN || task->tk_status == -EAGAIN)
-		return -EAGAIN;
-	/*
-	 * just restore original rpc call ops
-	 * rpc_release will be called later by the rpc scheduling layer.
-	 */
-	task->tk_ops = pdata->call_ops;
-	return 0;
-}
-
-/* Post-write completion function
- * Invoked by all layout drivers when write_pagelist is done.
- */
-static void
-pnfs_write_retry(struct work_struct *work)
-{
-	struct rpc_task *task;
-	struct nfs_write_data *wdata;
-	struct nfs4_pnfs_layout_segment range;
-
-	dprintk("%s enter\n", __func__);
-	task = container_of(work, struct rpc_task, u.tk_work);
-	wdata = container_of(task, struct nfs_write_data, task);
-	range.iomode = IOMODE_RW;
-	range.offset = wdata->args.offset;
-	range.length = wdata->args.count;
-	_pnfs_return_layout(wdata->inode, &range, NULL, RETURN_FILE, true);
-	pnfs_initiate_write(wdata, NFS_CLIENT(wdata->inode),
-			    wdata->pdata.call_ops, wdata->pdata.how);
-}
-
-static void
-pnfs_writeback_done(struct nfs_write_data *data)
-{
-	struct pnfs_call_data *pdata = &data->pdata;
-
-	dprintk("%s: Begin (status %d)\n", __func__, data->task.tk_status);
-
-	if (pnfs_call_done(pdata, &data->task, data) == -EAGAIN) {
-		INIT_WORK(&data->task.u.tk_work, pnfs_write_retry);
-		queue_work(nfsiod_workqueue, &data->task.u.tk_work);
-	}
-}
-
 /*
  * Call the appropriate parallel I/O subsystem write function.
  * If no I/O device driver exists, or one does match the returned
@@ -1506,40 +1456,6 @@ pnfs_writepages(struct nfs_write_data *wdata, int how)
 	return trypnfs;
 }
 
-/* Post-read completion function.  Invoked by all layout drivers when
- * read_pagelist is done
- */
-static void
-pnfs_read_retry(struct work_struct *work)
-{
-	struct rpc_task *task;
-	struct nfs_read_data *rdata;
-	struct nfs4_pnfs_layout_segment range;
-
-	dprintk("%s enter\n", __func__);
-	task = container_of(work, struct rpc_task, u.tk_work);
-	rdata = container_of(task, struct nfs_read_data, task);
-	range.iomode = IOMODE_RW;
-	range.offset = rdata->args.offset;
-	range.length = rdata->args.count;
-	_pnfs_return_layout(rdata->inode, &range, NULL, RETURN_FILE, true);
-	pnfs_initiate_read(rdata, NFS_CLIENT(rdata->inode),
-			   rdata->pdata.call_ops);
-}
-
-static void
-pnfs_read_done(struct nfs_read_data *data)
-{
-	struct pnfs_call_data *pdata = &data->pdata;
-
-	dprintk("%s: Begin (status %d)\n", __func__, data->task.tk_status);
-
-	if (pnfs_call_done(pdata, &data->task, data) == -EAGAIN) {
-		INIT_WORK(&data->task.u.tk_work, pnfs_read_retry);
-		queue_work(nfsiod_workqueue, &data->task.u.tk_work);
-	}
-}
-
 /*
  * Call the appropriate parallel I/O subsystem read function.
  * If no I/O device driver exists, or one does match the returned
@@ -1623,28 +1539,6 @@ _pnfs_try_to_commit(struct nfs_write_data *data,
 	return pnfs_commit(data, how);
 }
 
-/* pNFS Commit callback function for all layout drivers */
-static void
-pnfs_commit_done(struct nfs_write_data *data)
-{
-	struct pnfs_call_data *pdata = &data->pdata;
-
-	dprintk("%s: Begin (status %d)\n", __func__, data->task.tk_status);
-
-	if (pnfs_call_done(pdata, &data->task, data) == -EAGAIN) {
-		struct nfs4_pnfs_layout_segment range = {
-			.iomode = IOMODE_RW,
-			.offset = data->args.offset,
-			.length = data->args.count,
-		};
-		dprintk("%s: retrying\n", __func__);
-		_pnfs_return_layout(data->inode, &range, NULL, RETURN_FILE,
-				    true);
-		pnfs_initiate_commit(data, NFS_CLIENT(data->inode),
-				     pdata->call_ops, pdata->how, 1);
-	}
-}
-
 static enum pnfs_try_status
 pnfs_commit(struct nfs_write_data *data, int sync)
 {
@@ -1796,9 +1690,6 @@ out_free:
  */
 struct pnfs_client_operations pnfs_ops = {
 	.nfs_getdeviceinfo = nfs4_pnfs_getdeviceinfo,
-	.nfs_readlist_complete = pnfs_read_done,
-	.nfs_writelist_complete = pnfs_writeback_done,
-	.nfs_commit_complete = pnfs_commit_done,
 };
 
 EXPORT_SYMBOL(pnfs_unregister_layoutdriver);
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index a987d06..a88cd69 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -279,15 +279,6 @@ extern void nfs4_unset_layout_deviceid(struct pnfs_layout_segment *,
 struct pnfs_client_operations {
 	int (*nfs_getdeviceinfo) (struct nfs_server *,
 				  struct pnfs_device *dev);
-
-	/* Post read callback. */
-	void (*nfs_readlist_complete) (struct nfs_read_data *nfs_data);
-
-	/* Post write callback. */
-	void (*nfs_writelist_complete) (struct nfs_write_data *nfs_data);
-
-	/* Post commit callback. */
-	void (*nfs_commit_complete) (struct nfs_write_data *nfs_data);
 	void (*nfs_return_layout) (struct inode *);
 };
 
-- 
1.6.6.1


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

* [PATCH 4/4] pnfs-submit: Remove pnfs_error
  2010-06-13 20:18     ` [PATCH 3/4] pnfs-submit: Remove pnfs_call_done and friends Fred Isaman
@ 2010-06-13 20:18       ` Fred Isaman
  0 siblings, 0 replies; 6+ messages in thread
From: Fred Isaman @ 2010-06-13 20:18 UTC (permalink / raw)
  To: linux-nfs

It was only being used to signal EAGAIN to the no longer existing
pnfs_call_done functions.

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

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 9a3ea49..8a83c0d 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -254,9 +254,6 @@ filelayout_read_pagelist(struct pnfs_layout_type *layoutid,
 	/* Perform an asynchronous read */
 	nfs_initiate_read(data, ds->ds_clp->cl_rpcclient,
 			  &filelayout_read_call_ops);
-
-	data->pdata.pnfs_error = 0;
-
 	return PNFS_ATTEMPTED;
 }
 
@@ -304,8 +301,6 @@ filelayout_write_pagelist(struct pnfs_layout_type *layoutid,
 	 */
 	nfs_initiate_write(data, ds->ds_clp->cl_rpcclient,
 			   &filelayout_write_call_ops, sync);
-
-	data->pdata.pnfs_error = 0;
 	return PNFS_ATTEMPTED;
 }
 
@@ -678,7 +673,6 @@ filelayout_commit(struct pnfs_layout_type *layoutid, int sync,
 	}
 	kfree(clone_list);
 	kfree(ds_page_list);
-	data->pdata.pnfs_error = 0;
 	return PNFS_ATTEMPTED;
 
  mem_error:
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 7795e3e..3f7f50a 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1513,7 +1513,6 @@ _pnfs_try_to_read_data(struct nfs_read_data *data,
 {
 	dprintk("%s: Utilizing pNFS I/O\n", __func__);
 	data->pdata.call_ops = call_ops;
-	data->pdata.pnfs_error = 0;
 	return pnfs_readpages(data);
 }
 
@@ -1523,7 +1522,6 @@ _pnfs_try_to_write_data(struct nfs_write_data *data,
 {
 	dprintk("--> %s\n", __func__);
 	data->pdata.call_ops = call_ops;
-	data->pdata.pnfs_error = 0;
 	data->pdata.how = how;
 	return pnfs_writepages(data, how);
 }
@@ -1534,7 +1532,6 @@ _pnfs_try_to_commit(struct nfs_write_data *data,
 {
 	dprintk("%s: Utilizing pNFS I/O\n", __func__);
 	data->pdata.call_ops = call_ops;
-	data->pdata.pnfs_error = 0;
 	data->pdata.how = how;
 	return pnfs_commit(data, how);
 }
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 60bddc1..e802cec 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -185,16 +185,6 @@ static inline void pnfs_update_layout(struct inode *ino,
 	}
 }
 
-static inline int pnfs_get_write_status(struct nfs_write_data *data)
-{
-	return data->pdata.pnfs_error;
-}
-
-static inline int pnfs_get_read_status(struct nfs_read_data *data)
-{
-	return data->pdata.pnfs_error;
-}
-
 #else  /* CONFIG_NFS_V4_1 */
 
 static inline void get_lseg(struct pnfs_layout_segment *lseg)
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 9cabf88..6a18b9c 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -205,8 +205,7 @@ int pnfs_initiate_read(struct nfs_read_data *data, struct rpc_clnt *clnt,
 		       const struct rpc_call_ops *call_ops)
 {
 	if (pnfs_try_to_read_data(data, call_ops) == PNFS_ATTEMPTED)
-		return pnfs_get_read_status(data);
-
+		return 0;
 	return nfs_initiate_read(data, clnt, call_ops);
 }
 
@@ -400,9 +399,6 @@ static void nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data
 	argp->offset += resp->count;
 	argp->pgbase += resp->count;
 	argp->count -= resp->count;
-#ifdef CONFIG_NFS_V4_1
-	data->pdata.pnfs_error = -EAGAIN;
-#endif /* CONFIG_NFS_V4_1 */
 	nfs_restart_rpc(task, clp);
 }
 
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 65e2c62..2f80b20 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -851,8 +851,7 @@ int pnfs_initiate_write(struct nfs_write_data *data,
 			int how)
 {
 	if (pnfs_try_to_write_data(data, call_ops, how) == PNFS_ATTEMPTED)
-		return pnfs_get_write_status(data);
-
+		return 0;
 	return nfs_initiate_write(data, clnt, call_ops, how);
 }
 
@@ -1258,9 +1257,6 @@ int nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
 				 */
 				argp->stable = NFS_FILE_SYNC;
 			}
-#ifdef CONFIG_NFS_V4_1
-			data->pdata.pnfs_error = -EAGAIN;
-#endif /* CONFIG_NFS_V4_1 */
 			nfs_restart_rpc(task, clp);
 			return -EAGAIN;
 		}
@@ -1350,8 +1346,7 @@ int pnfs_initiate_commit(struct nfs_write_data *data,
 {
 	if (pnfs &&
 	    (pnfs_try_to_commit(data, &nfs_commit_ops, how) == PNFS_ATTEMPTED))
-		return pnfs_get_write_status(data);
-
+		return 0;
 	return nfs_initiate_commit(data, clnt, &nfs_commit_ops, how);
 }
 
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index aa41a3c..01d45ce 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -973,7 +973,6 @@ struct pnfs_call_data {
 	struct pnfs_layout_segment *lseg;
 	const struct rpc_call_ops *call_ops;
 	u32			orig_count;	/* for retry via MDS */
-	int			pnfs_error;
 	u8			how;		/* for FLUSH_STABLE */
 };
 
-- 
1.6.6.1


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

* Re: [PATCH 0/4]: Fix EAGAIN handling for the filelayout
  2010-06-13 20:18 [PATCH 0/4]: Fix EAGAIN handling for the filelayout Fred Isaman
  2010-06-13 20:18 ` [PATCH 1/4] pnfs-submit: filelayout: Stop using pnfs_call_done and friends Fred Isaman
@ 2010-06-15  0:08 ` Benny Halevy
  1 sibling, 0 replies; 6+ messages in thread
From: Benny Halevy @ 2010-06-15  0:08 UTC (permalink / raw)
  To: Fred Isaman; +Cc: linux-nfs

On Jun. 13, 2010, 16:18 -0400, Fred Isaman <iisaman@netapp.com> wrote:
> These patches remove pnfs_call_done and all the routines associated with it.
> They were quite buggy for filelayout, and tended to crash the client anytime
> EAGAIN handling was invoked (in particular on short reads.)
> 
> The first patch just has filelayout avoid using them entirely. It should NOT
> be reverted in the post-submit.
> 
> The subsequent patches remove the unused code for pnfs-submit. It is
> expected they will be reverted in the post-submit.
> 
> Fred
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Merged at pnfs-all-2.6.35-rc3-2010-06-14 pnfs-submit
patches 2/4 to 4/4 reverted in pnfs post submit.

Thanks!

Benny

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

end of thread, other threads:[~2010-06-15  0:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-13 20:18 [PATCH 0/4]: Fix EAGAIN handling for the filelayout Fred Isaman
2010-06-13 20:18 ` [PATCH 1/4] pnfs-submit: filelayout: Stop using pnfs_call_done and friends Fred Isaman
2010-06-13 20:18   ` [PATCH 2/4] pnfs-submit: Remove checks for non-rpc drivers Fred Isaman
2010-06-13 20:18     ` [PATCH 3/4] pnfs-submit: Remove pnfs_call_done and friends Fred Isaman
2010-06-13 20:18       ` [PATCH 4/4] pnfs-submit: Remove pnfs_error Fred Isaman
2010-06-15  0:08 ` [PATCH 0/4]: Fix EAGAIN handling for the filelayout Benny Halevy

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.