summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2012-08-02 20:37:39 +0530
committerAnand Avati <avati@redhat.com>2012-08-02 13:18:58 -0700
commite7897b80ba38066af2dc306b98c466e9cfe87e81 (patch)
tree0b75dee042391a45b20d3574a15d4c38ff9ca604 /xlators/mgmt/glusterd/src/glusterd-replace-brick.c
parent5f766567423ba8272f29397fe36da1fd2186ffaf (diff)
glusterd: Fix glusterd crash resulting from uninitialised pointer
PROBLEM: glusterd crashes during replace-brick operation as the pointer old_brickinfo is dereferenced without being initialised. FIX: Have old_brickinfo initialised to point to the brick info of the brick being replaced before dereferencing it. TEST: Ran glusterd in debug mode before and after the fix; process crash ceased in the latter case. Change-Id: I53f21b5424f534bbdba3b3fc407d4501a2c0052f BUG: 844332 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.com/3777 Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-replace-brick.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index 86c4d6e2d..61ee5d082 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -1369,6 +1369,12 @@ glusterd_op_perform_replace_brick (glusterd_volinfo_t *volinfo,
goto out;
ret = glusterd_resolve_brick (new_brickinfo);
+
+ if (ret)
+ goto out;
+
+ ret = glusterd_volume_brickinfo_get_by_brick (old_brick,
+ volinfo, &old_brickinfo);
if (ret)
goto out;