From: andros@netapp.com
To: bhalevy@panasas.com
Cc: linux-nfs@vger.kernel.org, Andy Adamson <andros@netapp.com>
Subject: [PATCH 5/8] SQUASHME pnfs-submit: add error handling to layout return
Date: Tue, 22 Jun 2010 17:56:35 -0400 [thread overview]
Message-ID: <1277243798-8181-6-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1277243798-8181-5-git-send-email-andros@netapp.com>
From: Andy Adamson <andros@netapp.com>
Signed-off-by: Andy Adamson <andros@netapp.com>
---
fs/nfs/nfs4proc.c | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5ffdfe1..0ab875f 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5641,6 +5641,11 @@ static void nfs4_pnfs_layoutreturn_done(struct rpc_task *task, void *calldata)
dprintk("--> %s\n", __func__);
nfs4_sequence_done(server, &lrp->res.seq_res, task->tk_status);
+ if (RPC_ASSASSINATED(task))
+ return;
+
+ if (nfs4_async_handle_error(task, server, NULL, NULL) == -EAGAIN)
+ nfs_restart_rpc(task, server->nfs_client);
dprintk("<-- %s\n", __func__);
}
@@ -5667,7 +5672,7 @@ static const struct rpc_call_ops nfs4_pnfs_layoutreturn_call_ops = {
.rpc_release = nfs4_pnfs_layoutreturn_release,
};
-int pnfs4_proc_layoutreturn(struct nfs4_pnfs_layoutreturn *lrp, bool wait)
+int _pnfs4_proc_layoutreturn(struct nfs4_pnfs_layoutreturn *lrp, bool issync)
{
struct inode *ino = lrp->args.inode;
struct nfs_server *server = NFS_SERVER(ino);
@@ -5689,21 +5694,33 @@ int pnfs4_proc_layoutreturn(struct nfs4_pnfs_layoutreturn *lrp, bool wait)
dprintk("--> %s\n", __func__);
lrp->res.seq_res.sr_slotid = NFS4_MAX_SLOT_TABLE;
task = rpc_run_task(&task_setup_data);
- if (IS_ERR(task)) {
- status = PTR_ERR(task);
+ if (IS_ERR(task))
+ return PTR_ERR(task);
+ if (!issync)
goto out;
- }
- if (wait) {
- status = nfs4_wait_for_completion_rpc_task(task);
- if (status == 0)
- status = task->tk_status;
- }
- rpc_put_task(task);
+ status = nfs4_wait_for_completion_rpc_task(task);
+ if (status != 0)
+ goto out;
+ status = task->tk_status;
out:
dprintk("<-- %s\n", __func__);
+ rpc_put_task(task);
return status;
}
+int pnfs4_proc_layoutreturn(struct nfs4_pnfs_layoutreturn *lrp, bool issync)
+{
+ struct nfs_server *server = NFS_SERVER(lrp->args.inode);
+ struct nfs4_exception exception = { };
+ int err;
+ do {
+ err = nfs4_handle_exception(server,
+ _pnfs4_proc_layoutreturn(lrp, issync),
+ &exception);
+ } while (exception.retry);
+ return err;
+}
+
int nfs4_pnfs_getdeviceinfo(struct nfs_server *server, struct pnfs_device *pdev)
{
struct nfs4_pnfs_getdeviceinfo_arg args = {
--
1.6.6
next prev parent reply other threads:[~2010-06-22 21:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-22 21:56 [PATCH 0/8] pnfs-submit add layoutget, layoutreturn error handling andros
2010-06-22 21:56 ` [PATCH 1/8] SQUASHME: pnfs-submit remove unused filelayout_mount_type andros
2010-06-22 21:56 ` [PATCH 2/8] SQUASHME pnfs-submit: pnfs_try_to_read, write, commit using freed memory andros
2010-06-22 21:56 ` [PATCH 3/8] SQUASHME pnfs-submit: tell commit to use the MDS andros
2010-06-22 21:56 ` [PATCH 4/8] SQUASHME pnfs-submit: remove encode_layoutreturn andros
2010-06-22 21:56 ` andros [this message]
2010-06-22 21:56 ` [PATCH 6/8] SQUASHME pnfs-submit: handle assassinated layoutcommit andros
2010-06-22 21:56 ` [PATCH 7/8] SQUASHME pnfs-submit: add error handlers to layout get andros
2010-06-22 21:56 ` [PATCH 8/8] pnfs-post-submit: restore encode_layoutreturn andros
2010-06-23 7:41 ` [PATCH 7/8] SQUASHME pnfs-submit: add error handlers to layout get Benny Halevy
2010-06-23 13:04 ` William A. (Andy) Adamson
[not found] ` <AANLkTinew-MgRJeswY3x7gJS-GBE_WMHhJdkWnrNGuo4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-23 19:23 ` William A. (Andy) Adamson
2010-06-23 13:34 ` [PATCH 3/8] SQUASHME pnfs-submit: tell commit to use the MDS Fred Isaman
[not found] ` <AANLkTimh37nfPbw5CZmBJv1XhIqrlogV_0nUVSDaxZJ3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-23 13:53 ` Andy Adamson
2010-06-23 14:11 ` Fred Isaman
[not found] ` <AANLkTikzfFVMd76tevedVeQ4Q6ot5wxXZ8fxKFNz_zyK-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-23 14:24 ` Andy Adamson
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=1277243798-8181-6-git-send-email-andros@netapp.com \
--to=andros@netapp.com \
--cc=bhalevy@panasas.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