Commit f9c96fcc authored by Andy Adamson's avatar Andy Adamson Committed by Trond Myklebust

NFSv4.1 free slot before resending I/O to MDS

Fix a dynamic session slot leak where a slot is preallocated and I/O is
resent through the MDS.
Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 4db72b40
...@@ -270,6 +270,7 @@ static inline struct nfs4_session *nfs4_get_session(const struct nfs_server *ser ...@@ -270,6 +270,7 @@ static inline struct nfs4_session *nfs4_get_session(const struct nfs_server *ser
extern int nfs41_setup_sequence(struct nfs4_session *session, extern int nfs41_setup_sequence(struct nfs4_session *session,
struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, struct nfs4_sequence_args *args, struct nfs4_sequence_res *res,
struct rpc_task *task); struct rpc_task *task);
extern int nfs41_sequence_done(struct rpc_task *, struct nfs4_sequence_res *);
extern int nfs4_proc_create_session(struct nfs_client *, struct rpc_cred *); extern int nfs4_proc_create_session(struct nfs_client *, struct rpc_cred *);
extern int nfs4_proc_destroy_session(struct nfs4_session *, struct rpc_cred *); extern int nfs4_proc_destroy_session(struct nfs4_session *, struct rpc_cred *);
extern int nfs4_proc_get_lease_time(struct nfs_client *clp, extern int nfs4_proc_get_lease_time(struct nfs_client *clp,
......
...@@ -335,8 +335,11 @@ static void filelayout_read_call_done(struct rpc_task *task, void *data) ...@@ -335,8 +335,11 @@ static void filelayout_read_call_done(struct rpc_task *task, void *data)
dprintk("--> %s task->tk_status %d\n", __func__, task->tk_status); dprintk("--> %s task->tk_status %d\n", __func__, task->tk_status);
if (test_bit(NFS_IOHDR_REDO, &rdata->header->flags) && if (test_bit(NFS_IOHDR_REDO, &rdata->header->flags) &&
task->tk_status == 0) task->tk_status == 0) {
if (rdata->res.seq_res.sr_slot != NULL)
nfs41_sequence_done(task, &rdata->res.seq_res);
return; return;
}
/* Note this may cause RPC to be resent */ /* Note this may cause RPC to be resent */
rdata->header->mds_ops->rpc_call_done(task, data); rdata->header->mds_ops->rpc_call_done(task, data);
...@@ -442,8 +445,11 @@ static void filelayout_write_call_done(struct rpc_task *task, void *data) ...@@ -442,8 +445,11 @@ static void filelayout_write_call_done(struct rpc_task *task, void *data)
struct nfs_write_data *wdata = data; struct nfs_write_data *wdata = data;
if (test_bit(NFS_IOHDR_REDO, &wdata->header->flags) && if (test_bit(NFS_IOHDR_REDO, &wdata->header->flags) &&
task->tk_status == 0) task->tk_status == 0) {
if (wdata->res.seq_res.sr_slot != NULL)
nfs41_sequence_done(task, &wdata->res.seq_res);
return; return;
}
/* Note this may cause RPC to be resent */ /* Note this may cause RPC to be resent */
wdata->header->mds_ops->rpc_call_done(task, data); wdata->header->mds_ops->rpc_call_done(task, data);
......
...@@ -592,7 +592,7 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res) ...@@ -592,7 +592,7 @@ static void nfs41_sequence_free_slot(struct nfs4_sequence_res *res)
nfs41_server_notify_highest_slotid_update(session->clp); nfs41_server_notify_highest_slotid_update(session->clp);
} }
static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *res) int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *res)
{ {
struct nfs4_session *session; struct nfs4_session *session;
struct nfs4_slot *slot; struct nfs4_slot *slot;
...@@ -692,6 +692,7 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res * ...@@ -692,6 +692,7 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
rpc_delay(task, NFS4_POLL_RETRY_MAX); rpc_delay(task, NFS4_POLL_RETRY_MAX);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(nfs41_sequence_done);
static int nfs4_sequence_done(struct rpc_task *task, static int nfs4_sequence_done(struct rpc_task *task,
struct nfs4_sequence_res *res) struct nfs4_sequence_res *res)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment