[PATCH 1/3] SQUASHME: pnfsd: move kfree of the cb_layout rpc_args to release time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
---
 fs/nfsd/nfs4callback.c          |    4 +++-
 include/linux/nfsd/nfsd4_pnfs.h |    2 ++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index c98e64f..cdf9d6d 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -1020,7 +1020,6 @@ static void nfsd4_cb_layout_done(struct rpc_task *task, void *calldata)
 	struct nfs4_client *clp = clr->clr_client;
 
 	nfsd4_cb_done_sequence(task, clp);
-	kfree(task->tk_msg.rpc_argp);
 
 	if (!task->tk_status)
 		return;
@@ -1057,6 +1056,8 @@ static void nfsd4_cb_layout_done(struct rpc_task *task, void *calldata)
 static void nfsd4_cb_layout_release(void *calldata)
 {
 	struct nfs4_layoutrecall *clr = calldata;
+	kfree(clr->clr_args);
+	clr->clr_args = NULL;
 	put_layoutrecall(clr);
 }
 
@@ -1086,6 +1087,7 @@ nfsd4_cb_layout(struct nfs4_layoutrecall *clr)
 		status = -ENOMEM;
 		goto out;
 	}
+	clr->clr_args = args;
 	args->args_op = clr;
 	msg.rpc_argp = args;
 	status = rpc_call_async(clnt, &msg, RPC_TASK_SOFT,
diff --git a/include/linux/nfsd/nfsd4_pnfs.h b/include/linux/nfsd/nfsd4_pnfs.h
index 2f4d493..2e66837 100644
--- a/include/linux/nfsd/nfsd4_pnfs.h
+++ b/include/linux/nfsd/nfsd4_pnfs.h
@@ -234,6 +234,8 @@ struct nfs4_layoutrecall {
 	struct timespec			clr_time;	/* last activity */
 	struct super_block 		*clr_sb; /* We might not have a file */
 	struct nfs4_layoutrecall	*parent; /* The initiating recall */
+
+	void				*clr_args;	/* nfsd internal */
 };
 
 struct nfsd4_pnfs_cb_dev_item {
-- 
1.6.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux