From 26043d1f8ed6892aca47abcb75cedfdc51e86a0a Mon Sep 17 00:00:00 2001 From: Vijaikumar M Date: Tue, 6 May 2014 14:56:23 +0530 Subject: glusterd/snapshot: Don't release big_lock before completing snapshot creation Releasing the big-lock can cause problem like deadlock or memory corruption. Same happened with bug 1091926 where glusterd on node-2 entered a commit phase and released a big-lock. The originator node received timeout for the commit phase and triggered a post-validate cleanup to the node-2. Now node-2 continued to work with the object that are alreday cleaned-up and resulted in a crash. Solution is to not to release big-lock in the commit phase of snapshot creation. Change-Id: I571194fdb0b0ecc91bd13f2a9fc92fe4338d14dc BUG: 1091926 Signed-off-by: Vijaikumar M Reviewed-on: http://review.gluster.org/7579 Tested-by: Gluster Build System Reviewed-by: Rajesh Joseph Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index 25b87b661e0..6cce4a89f08 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -1828,7 +1828,8 @@ out: } int -glusterd_start_volume (glusterd_volinfo_t *volinfo, int flags) +glusterd_start_volume (glusterd_volinfo_t *volinfo, int flags, + gf_boolean_t wait) { int ret = 0; @@ -1841,7 +1842,7 @@ glusterd_start_volume (glusterd_volinfo_t *volinfo, int flags) GF_ASSERT (volinfo); list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { - ret = glusterd_brick_start (volinfo, brickinfo, _gf_true); + ret = glusterd_brick_start (volinfo, brickinfo, wait); /* If 'force' try to start all bricks regardless of success or * failure */ @@ -1917,7 +1918,7 @@ glusterd_op_start_volume (dict_t *dict, char **op_errstr) } } - ret = glusterd_start_volume (volinfo, flags); + ret = glusterd_start_volume (volinfo, flags, _gf_true); if (ret) goto out; -- cgit