From 435603caeb651dc1050c85281e3838df9d37ce64 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 22 Sep 2010 09:43:45 +0000 Subject: distribute: in linkfile creation check for valid gfid in inode * if inode->gfid is not valid (ie, null), take the gfid from the parameter dictionary passed from higher layer Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1565 (deleting files after dht rebalance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1565 --- xlators/cluster/dht/src/dht-linkfile.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'xlators/cluster/dht/src/dht-linkfile.c') diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c index 1ecae5dfd..fa84ea29e 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, -- cgit