* [PATCH 0/3] pnfs callback fixes
@ 2010-06-18 20:59 Benny Halevy
2010-06-18 21:03 ` [PATCH 1/3] SQUASHME: pnfsd: move kfree of the cb_layout rpc_args to release time Benny Halevy
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Benny Halevy @ 2010-06-18 20:59 UTC (permalink / raw)
To: NFS list
A small crop of fixes for pnfs callbacks.
[PATCH 1/3] SQUASHME: pnfsd: move kfree of the cb_layout rpc_args to release time
[PATCH 2/3] SQUASHME: pnfsd: move kfree of the cb_device rpc_args to release time
[PATCH 3/3] pnfsd: reset status on NFS4ERR_NOMATCHING_LAYOUT
All of these patches, plus
bc210d8 pnfs: Fix num_ds bug in nfsd4_set_pnfs_dlm_device()
3baf7bf SQUASHME: pnfs-obj: use NFSDBG_PNFS_LD also in pnfs_osd_xdr_cli.c
are in pnfs-all-latest at pnfs-all-2.6.35-rc3-2010-06-18
I'll rebase them onto their respective branches after the Bakethon...
Benny
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] SQUASHME: pnfsd: move kfree of the cb_layout rpc_args to release time
2010-06-18 20:59 [PATCH 0/3] pnfs callback fixes Benny Halevy
@ 2010-06-18 21:03 ` Benny Halevy
2010-06-18 21:03 ` [PATCH 2/3] SQUASHME: pnfsd: move kfree of the cb_device " Benny Halevy
2010-06-18 21:03 ` [PATCH 3/3] pnfsd: reset status on NFS4ERR_NOMATCHING_LAYOUT Benny Halevy
2 siblings, 0 replies; 4+ messages in thread
From: Benny Halevy @ 2010-06-18 21:03 UTC (permalink / raw)
To: linux-nfs
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] SQUASHME: pnfsd: move kfree of the cb_device rpc_args to release time
2010-06-18 20:59 [PATCH 0/3] pnfs callback fixes Benny Halevy
2010-06-18 21:03 ` [PATCH 1/3] SQUASHME: pnfsd: move kfree of the cb_layout rpc_args to release time Benny Halevy
@ 2010-06-18 21:03 ` Benny Halevy
2010-06-18 21:03 ` [PATCH 3/3] pnfsd: reset status on NFS4ERR_NOMATCHING_LAYOUT Benny Halevy
2 siblings, 0 replies; 4+ messages in thread
From: Benny Halevy @ 2010-06-18 21:03 UTC (permalink / raw)
To: linux-nfs
Also, fix a bug in nfsd_device_notify_cb where the nfs4_notify_device
structure was kfreed while the async callback was in progress.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfsd/nfs4callback.c | 10 +++++++++-
fs/nfsd/nfs4pnfsd.c | 5 +++--
fs/nfsd/pnfsd.h | 2 ++
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index cdf9d6d..950e303 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -1113,7 +1113,6 @@ static void nfsd4_cb_device_done(struct rpc_task *task, void *calldata)
struct nfs4_client *clp = cbnd->nd_client;
nfsd4_cb_done_sequence(task, clp);
- kfree(task->tk_msg.rpc_argp);
dprintk("%s: clp %p cb_client %p: status %d\n",
__func__,
@@ -1128,9 +1127,18 @@ static void nfsd4_cb_device_done(struct rpc_task *task, void *calldata)
}
}
+static void nfsd4_cb_device_release(void *calldata)
+{
+ struct nfs4_notify_device *cbnd = calldata;
+ kfree(cbnd->nd_args);
+ cbnd->nd_args = NULL;
+ kfree(cbnd);
+}
+
static const struct rpc_call_ops nfsd4_cb_device_ops = {
.rpc_call_prepare = nfsd4_cb_device_prepare,
.rpc_call_done = nfsd4_cb_device_done,
+ .rpc_release = nfsd4_cb_device_release,
};
/*
diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c
index 2576848..5043878 100644
--- a/fs/nfsd/nfs4pnfsd.c
+++ b/fs/nfsd/nfs4pnfsd.c
@@ -1666,10 +1666,11 @@ int nfsd_device_notify_cb(struct super_block *sb,
list_del_init(&cbnd->nd_perclnt);
status2 = nfsd4_cb_notify_device(cbnd);
pnfs_clear_device_notify(cbnd->nd_client);
- if (status2)
+ if (status2) {
+ kfree(cbnd);
status = status2;
+ }
notify_num++;
- kfree(cbnd);
}
dprintk("NFSD %s: status %d clients %u\n",
diff --git a/fs/nfsd/pnfsd.h b/fs/nfsd/pnfsd.h
index dd5838f..a181bc3 100644
--- a/fs/nfsd/pnfsd.h
+++ b/fs/nfsd/pnfsd.h
@@ -109,6 +109,8 @@ struct nfs4_notify_device {
struct nfsd4_pnfs_cb_dev_list *nd_list;
struct nfs4_client *nd_client;
struct list_head nd_perclnt;
+
+ void *nd_args; /* nfsd internal */
};
u64 find_create_sbid(struct super_block *);
--
1.6.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] pnfsd: reset status on NFS4ERR_NOMATCHING_LAYOUT
2010-06-18 20:59 [PATCH 0/3] pnfs callback fixes Benny Halevy
2010-06-18 21:03 ` [PATCH 1/3] SQUASHME: pnfsd: move kfree of the cb_layout rpc_args to release time Benny Halevy
2010-06-18 21:03 ` [PATCH 2/3] SQUASHME: pnfsd: move kfree of the cb_device " Benny Halevy
@ 2010-06-18 21:03 ` Benny Halevy
2 siblings, 0 replies; 4+ messages in thread
From: Benny Halevy @ 2010-06-18 21:03 UTC (permalink / raw)
To: linux-nfs
Although it's encoded as an error on the protocol level
it's actualy a success, just short circuited.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
fs/nfsd/nfs4callback.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 950e303..f3b5015 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -1049,6 +1049,7 @@ static void nfsd4_cb_layout_done(struct rpc_task *task, void *calldata)
rpc_restart_call(task);
break;
case -NFS4ERR_NOMATCHING_LAYOUT:
+ task->tk_status = 0;
nomatching_layout(clr);
}
}
--
1.6.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-06-18 21:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-18 20:59 [PATCH 0/3] pnfs callback fixes Benny Halevy
2010-06-18 21:03 ` [PATCH 1/3] SQUASHME: pnfsd: move kfree of the cb_layout rpc_args to release time Benny Halevy
2010-06-18 21:03 ` [PATCH 2/3] SQUASHME: pnfsd: move kfree of the cb_device " Benny Halevy
2010-06-18 21:03 ` [PATCH 3/3] pnfsd: reset status on NFS4ERR_NOMATCHING_LAYOUT Benny Halevy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).