From: <andros@netapp.com>
To: <trond.myklebust@primarydata.com>
Cc: <linux-nfs@vger.kernel.org>, Andy Adamson <andros@netapp.com>
Subject: [PATCH 1/1] NFSv4.1 free slot before resending I/O to MDS
Date: Tue, 28 Jan 2014 18:01:14 -0500 [thread overview]
Message-ID: <1390950074-7245-2-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1390950074-7245-1-git-send-email-andros@netapp.com>
From: Andy Adamson <andros@netapp.com>
Free an allocated slot from nfs41_wake_and_assign_slot prior to rpc_exit.
Prevents a state_manager hang when draining a data server session.
Signed-off-by: Andy Adamson <andros@netapp.com>
---
fs/nfs/nfs4filelayout.c | 6 ++++++
fs/nfs/nfs4session.c | 1 +
2 files changed, 7 insertions(+)
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 03fd8be..9611999 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -314,6 +314,9 @@ static void filelayout_read_prepare(struct rpc_task *task, void *data)
if (filelayout_reset_to_mds(rdata->header->lseg)) {
dprintk("%s task %u reset io to MDS\n", __func__, task->tk_pid);
filelayout_reset_read(rdata);
+ if (rdata->res.seq_res.sr_slot != NULL)
+ nfs4_free_slot(&rdata->ds_clp->cl_session->fc_slot_table,
+ rdata->res.seq_res.sr_slot);
rpc_exit(task, 0);
return;
}
@@ -425,6 +428,9 @@ static void filelayout_write_prepare(struct rpc_task *task, void *data)
if (filelayout_reset_to_mds(wdata->header->lseg)) {
dprintk("%s task %u reset io to MDS\n", __func__, task->tk_pid);
filelayout_reset_write(wdata);
+ if (wdata->res.seq_res.sr_slot != NULL)
+ nfs4_free_slot(&wdata->ds_clp->cl_session->fc_slot_table,
+ wdata->res.seq_res.sr_slot);
rpc_exit(task, 0);
return;
}
diff --git a/fs/nfs/nfs4session.c b/fs/nfs/nfs4session.c
index cf883c7..5226846 100644
--- a/fs/nfs/nfs4session.c
+++ b/fs/nfs/nfs4session.c
@@ -98,6 +98,7 @@ void nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot)
dprintk("%s: slotid %u highest_used_slotid %u\n", __func__,
slotid, tbl->highest_used_slotid);
}
+EXPORT_SYMBOL_GPL(nfs4_free_slot);
static struct nfs4_slot *nfs4_new_slot(struct nfs4_slot_table *tbl,
u32 slotid, u32 seq_init, gfp_t gfp_mask)
--
1.8.3.1
next prev parent reply other threads:[~2014-01-28 23:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 23:01 [PATCH 0/1] NFSv4.1 free slot before resending I/O to MDS andros
2014-01-28 23:01 ` andros [this message]
2014-01-28 23:28 ` [PATCH 1/1] " Trond Myklebust
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=1390950074-7245-2-git-send-email-andros@netapp.com \
--to=andros@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
/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