diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2015-10-09 22:31:28 +0530 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2015-11-17 06:36:17 -0800 |
commit | 0f35b301fcb539dd85a1dae202b3ce532852d4d6 (patch) | |
tree | dd6bb7928e85042bb2779f19c2cd645b7e7bd20b /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 052bdb5899bb723b6d375c66ab2ceab028adab06 (diff) |
tests: spurious failure fix for bug-948686.t
Ensured import volume and volume start doesn't race in volinfo by refcounting
volinfo.
Change-Id: I7467eccaba9a00fd63ba0121d8157df24d1c00a6
BUG: 1258714
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/12329
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 8f8b3b36abd..a529fd3ca3f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -3878,9 +3878,14 @@ glusterd_import_friend_volume (dict_t *peer_data, size_t count) ret = glusterd_volinfo_find (new_volinfo->volname, &old_volinfo); if (0 == ret) { + /* Ref count the old_volinfo such that deleting it doesn't crash + * if its been already in use by other thread + */ + glusterd_volinfo_ref (old_volinfo); (void) gd_check_and_update_rebalance_info (old_volinfo, new_volinfo); (void) glusterd_delete_stale_volume (old_volinfo, new_volinfo); + glusterd_volinfo_unref (old_volinfo); } if (glusterd_is_volume_started (new_volinfo)) { |