summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2012-04-18 14:30:16 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-27 22:33:18 -0700
commit3d653908554dc92af6b7414df4083bee2b9e039f (patch)
treef6cd404abb8ce5734a37dc80119192cdc1edc9e9 /xlators/mgmt
parentc4d4d9d1d3ec4565346efcfe8bdc6c10b8d5ba2d (diff)
glusterd: Disconnected bricks of 'stale' volume before deleting it.
If glusterd_delete_bricks is called before glusterd got the DISCONNECT event from the brick that was stopped, then glusterd_brick_rpc_notify would dereference a free'd brickinfo. This can happen if the brick had not been disconnected before. Change-Id: I6c07ec50f6739422a14478a549edd06c4c0ce913 BUG: 802015 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/3442 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index f04792c7b9a..ab72d85149a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -2420,7 +2420,8 @@ glusterd_delete_stale_volume (glusterd_volinfo_t *stale_volinfo,
* stop stale bricks. Stale volume information is going to be deleted.
* Which deletes the valid brick information inside stale volinfo.
* We dont want brick_rpc_notify to access already deleted brickinfo.
- * Disconnect valid bricks.
+ * Disconnect all bricks from stale_volinfo (unconditionally), since
+ * they are being deleted subsequently.
*/
if (glusterd_is_volume_started (stale_volinfo)) {
if (glusterd_is_volume_started (valid_volinfo)) {
@@ -2429,10 +2430,12 @@ glusterd_delete_stale_volume (glusterd_volinfo_t *stale_volinfo,
//Only valid bricks will be running now.
(void) glusterd_volinfo_copy_brick_portinfo (valid_volinfo,
stale_volinfo);
- (void) glusterd_volume_disconnect_all_bricks (stale_volinfo);
+
} else {
(void) glusterd_stop_bricks (stale_volinfo);
}
+
+ (void) glusterd_volume_disconnect_all_bricks (stale_volinfo);
}
/* Delete all the bricks and stores and vol files. They will be created
* again by the valid_volinfo. Volume store delete should not be