From a4d35ccb8afeefae4d9cdd36ac19b0e97d0d04d0 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Mon, 13 Jun 2016 12:26:24 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/14707 Reviewed-by: N Balachandran Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Poornima G Reviewed-by: Susant Palai CentOS-regression: Gluster Build System Reviewed-by: Jeff Darcy --- xlators/cluster/dht/src/dht-selfheal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xlators/cluster') 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, -- cgit