summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-selfheal.c
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2016-06-13 12:26:24 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-06-17 05:23:50 -0700
commita4d35ccb8afeefae4d9cdd36ac19b0e97d0d04d0 (patch)
tree59ced6c3d1dd33068a9f941e218942f8b7f4a0ac /xlators/cluster/dht/src/dht-selfheal.c
parentb5c492dfea2d2e2075aa88d7153fba57b06e739d (diff)
cluster/dht: initialize cbk before attempting inode-link
Otherwise inode-link failures in selfheal codepath will result in a crash. Change-Id: I9061629ae9d1eb1ac945af5f448d0d8b397a5022 BUG: 1345748 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/14707 Reviewed-by: N Balachandran <nbalacha@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Poornima G <pgurusid@redhat.com> Reviewed-by: Susant Palai <spalai@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-selfheal.c')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index a8c0ba7bc4d..a208fdb3e1b 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -2046,6 +2046,9 @@ dht_selfheal_directory (call_frame_t *frame, dht_selfheal_dir_cbk_t dir_cbk,
local = frame->local;
this = frame->this;
+ local->selfheal.dir_cbk = dir_cbk;
+ local->selfheal.layout = dht_layout_ref (this, layout);
+
if (!__is_root_gfid (local->stbuf.ia_gfid)) {
gf_uuid_unparse(local->stbuf.ia_gfid, gfid);
gf_uuid_unparse(loc->parent->gfid, pgfid);
@@ -2075,9 +2078,6 @@ dht_selfheal_directory (call_frame_t *frame, dht_selfheal_dir_cbk_t dir_cbk,
down = local->selfheal.down;
misc = local->selfheal.misc;
- local->selfheal.dir_cbk = dir_cbk;
- local->selfheal.layout = dht_layout_ref (this, layout);
-
if (down) {
gf_msg (this->name, GF_LOG_WARNING, 0,
DHT_MSG_DIR_SELFHEAL_FAILED,