From fa3ca3c61fbd7ad95f57f0522624396b8f05ecf6 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 23 Sep 2010 06:30:43 +0000 Subject: distribute: don't update the inode's gfid directly Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1680 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1680 --- xlators/cluster/dht/src/dht-selfheal.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'xlators/cluster/dht/src/dht-selfheal.c') diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index e2dde3cd5..23a39d48a 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -267,14 +267,23 @@ dht_selfheal_dir_mkdir (call_frame_t *frame, loc_t *loc, } local->call_cnt = missing_dirs; - dict = dict_new (); - if (!dict) - return -1; + if (!uuid_is_null (local->gfid)) { + dict = dict_new (); + if (!dict) + return -1; + + ret = dict_set_static_bin (dict, "gfid-req", local->gfid, 16); + if (ret) + gf_log (this->name, GF_LOG_INFO, + "failed to set gfid in dict"); + } else if (local->params) { + /* Send the dictionary from higher layers directly */ + dict = dict_ref (local->params); + } - ret = dict_set_static_bin (dict, "gfid-req", loc->inode->gfid, 16); - if (ret) - gf_log (this->name, GF_LOG_INFO, - "failed to set gfid in dict"); + if (!dict) + gf_log (this->name, GF_LOG_DEBUG, + "dict is NULL, need to make sure gfid's are same"); for (i = 0; i < layout->cnt; i++) { if (layout->list[i].err == ENOENT || force) { -- cgit