summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-selfheal.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht/src/dht-selfheal.c')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index e2dde3cd565..23a39d48ade 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) {