summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-22 09:43:45 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-22 08:23:01 -0700
commit435603caeb651dc1050c85281e3838df9d37ce64 (patch)
treed002ba0da708ec7b098db27a3d6ab2e617f52f8e
parent66b1613efdae3ba2740241ee325e5f0b0634424d (diff)
distribute: in linkfile creation check for valid gfid in inodev3.1.0qa28
* if inode->gfid is not valid (ie, null), take the gfid from the parameter dictionary passed from higher layer Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1565 (deleting files after dht rebalance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1565
-rw-r--r--xlators/cluster/dht/src/dht-linkfile.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c
index 1ecae5d..fa84ea2 100644
--- a/xlators/cluster/dht/src/dht-linkfile.c
+++ b/xlators/cluster/dht/src/dht-linkfile.c
@@ -123,21 +123,21 @@ dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk,
local->linkfile.srcvol = tovol;
loc_copy (&local->linkfile.loc, loc);
- dict = dict_new ();
- if (!dict)
- goto out;
-
- ret = dict_set_static_bin (dict, "gfid-req", loc->inode->gfid, 16);
- if (ret)
- gf_log ("dht-linkfile", GF_LOG_DEBUG, "gfid set failed");
+ if (!uuid_is_null (loc->inode->gfid)) {
+ dict = dict_new ();
+ if (!dict)
+ goto out;
+ ret = dict_set_static_bin (dict, "gfid-req", loc->inode->gfid, 16);
+ if (ret)
+ gf_log ("dht-linkfile", GF_LOG_DEBUG, "gfid set failed");
+ } else if (local->params) {
+ dict = dict_ref (local->params);
+ }
STACK_WIND (frame, dht_linkfile_create_cbk,
fromvol, fromvol->fops->mknod, loc,
S_IFREG | DHT_LINKFILE_MODE, 0, dict);
- if (dict)
- dict_unref (dict);
-
return 0;
out:
local->linkfile.linkfile_cbk (frame, NULL, frame->this, -1, ENOMEM,