From: Fred Isaman <iisaman@netapp.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 1/4] pnfs-submit: filelayout: Stop using pnfs_call_done and friends
Date: Sun, 13 Jun 2010 16:18:39 -0400 [thread overview]
Message-ID: <1276460322-13873-2-git-send-email-iisaman@netapp.com> (raw)
In-Reply-To: <1276460322-13873-1-git-send-email-iisaman@netapp.com>
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
next prev parent reply other threads:[~2010-06-13 20:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-13 20:18 [PATCH 0/4]: Fix EAGAIN handling for the filelayout Fred Isaman
2010-06-13 20:18 ` Fred Isaman [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1276460322-13873-2-git-send-email-iisaman@netapp.com \
--to=iisaman@netapp.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox