summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2014-01-29 11:34:38 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-01-29 11:54:55 -0500
commitf9c96fcc501a43dbc292b17fc0ded4b54e63b79d (patch)
tree50feb8393e5fa42095511a1417dbe56def085569 /fs/nfs/nfs4filelayout.c
parent4db72b40fdbc706f8957e9773ae73b1574b8c694 (diff)
downloadop-kernel-dev-f9c96fcc501a43dbc292b17fc0ded4b54e63b79d.zip
op-kernel-dev-f9c96fcc501a43dbc292b17fc0ded4b54e63b79d.tar.gz
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: Andy Adamson <andros@netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4filelayout.c')
-rw-r--r--fs/nfs/nfs4filelayout.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 03fd8be..20a56fa 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -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);
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;
+ }
/* Note this may cause RPC to be resent */
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)
struct nfs_write_data *wdata = data;
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;
+ }
/* Note this may cause RPC to be resent */
wdata->header->mds_ops->rpc_call_done(task, data);
OpenPOWER on IntegriCloud