summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-selfheal.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-23 06:30:43 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-23 07:51:06 -0700
commitfa3ca3c61fbd7ad95f57f0522624396b8f05ecf6 (patch)
tree56a7c29fc49401544d8c9ac74cb213d36ed83347 /xlators/cluster/dht/src/dht-selfheal.c
parenta2e35ea0166c42435f860990c9476dda470843c8 (diff)
distribute: don't update the inode's gfid directly
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1680 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1680
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 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) {