diff options
author | Amar Tumballi <amar@gluster.com> | 2010-09-22 08:50:23 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-22 08:09:33 -0700 |
commit | 66b1613efdae3ba2740241ee325e5f0b0634424d (patch) | |
tree | aa59b0c764c1f42e2aec3d9e54e57efd0e5dbb32 /xlators/cluster/dht/src/dht-selfheal.c | |
parent | 0a14d255dcd6fa3e9d575bae1fecd164763104bb (diff) |
distribute: while selfhealing directory, send proper gfid in dict
* this was the root cause for having layout mismatches in case of
add-brick, because the gfid of directories on newly added brick
was always mismatching, which caused many operation on that
particular brick fail.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1629 (files missing during add-brick)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1629
Diffstat (limited to 'xlators/cluster/dht/src/dht-selfheal.c')
-rw-r--r-- | xlators/cluster/dht/src/dht-selfheal.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index 6b3e13b1a..e2dde3cd5 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -247,10 +247,11 @@ dht_selfheal_dir_mkdir (call_frame_t *frame, loc_t *loc, dht_layout_t *layout, int force) { int missing_dirs = 0; - int i = 0; + int i = 0; + int ret = -1; dht_local_t *local = NULL; xlator_t *this = NULL; - + dict_t *dict = NULL; local = frame->local; this = frame->this; @@ -266,6 +267,15 @@ dht_selfheal_dir_mkdir (call_frame_t *frame, loc_t *loc, } local->call_cnt = missing_dirs; + dict = dict_new (); + if (!dict) + return -1; + + 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"); + for (i = 0; i < layout->cnt; i++) { if (layout->list[i].err == ENOENT || force) { gf_log (this->name, GF_LOG_TRACE, @@ -278,10 +288,13 @@ dht_selfheal_dir_mkdir (call_frame_t *frame, loc_t *loc, loc, st_mode_from_ia (local->stbuf.ia_prot, local->stbuf.ia_type), - NULL); + dict); } } + if (dict) + dict_unref (dict); + return 0; } |