summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-07-12 05:29:25 +0000
committerAnand Avati <avati@gluster.com>2011-07-12 05:37:17 -0700
commit42e0b1731d925fd5a0bfaa107a2e01ba47fae125 (patch)
tree6832fa9a42ead07f0dee487c5ffce9e40fdf93db /xlators/cluster
parent2c688714a2a081fc1be30febcd839caf8e201456 (diff)
cluster/distribute: send proper 'params' dictionary during linkfile creation
when the code path enters the 'subvol_filled()' case, local->params is set, which contains the 'gfid-req' value, but the linkfile creation was not checking for its existance. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3159 (mknod (linkfile creation) with no 'gfid-req' key) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3159
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-linkfile.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c
index 76f1df501..e936f3119 100644
--- a/xlators/cluster/dht/src/dht-linkfile.c
+++ b/xlators/cluster/dht/src/dht-linkfile.c
@@ -52,15 +52,20 @@ dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk,
{
dht_local_t *local = NULL;
dict_t *dict = NULL;
+ int need_unref = 0;
int ret = 0;
local = frame->local;
local->linkfile.linkfile_cbk = linkfile_cbk;
local->linkfile.srcvol = tovol;
- dict = dict_new ();
- if (!dict)
- goto out;
+ dict = local->params;
+ if (!dict) {
+ dict = dict_new ();
+ if (!dict)
+ goto out;
+ need_unref = 1;
+ }
if (!uuid_is_null (local->gfid)) {
ret = dict_set_static_bin (dict, "gfid-req", local->gfid, 16);
@@ -83,13 +88,17 @@ dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk,
fromvol, fromvol->fops->mknod, loc,
S_IFREG | DHT_LINKFILE_MODE, 0, dict);
- if (dict)
+ if (need_unref && dict)
dict_unref (dict);
return 0;
out:
local->linkfile.linkfile_cbk (frame, NULL, frame->this, -1, ENOMEM,
loc->inode, NULL, NULL, NULL);
+
+ if (need_unref && dict)
+ dict_unref (dict);
+
return 0;
}