From 7445593036e411ef96b741448fab89284f91e7f8 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Thu, 5 Jun 2014 04:44:25 +0000 Subject: glusterd/snapshot: Don't update the snap volume's op_version After the features.barrier key is removed from the snap_vol dict, it's op_version should also be updated, so that it doesn't inherit the op_version of the original volume when it had the key set. Also in glusterd_volinfo_dup(), which duplicates volinfo the volume op_version should not be updated, rather the original volume's op_version should be used. Change-Id: Ib2250700f649e6c906b14aeccee5e78f71d69780 BUG: 1104944 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/7986 Reviewed-by: Rajesh Joseph Reviewed-by: Atin Mukherjee Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-snapshot.c | 4 +++- xlators/mgmt/glusterd/src/glusterd-utils.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index 7a6d143e5de..f4e8ff8977e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -3846,9 +3846,11 @@ glusterd_do_snap_vol (glusterd_volinfo_t *origin_vol, glusterd_snap_t *snap, * and in-turn snapshot restore the barrier value is set to enable. * Because of this further I/O on the mount point fails. * Hence remove the barrier key from newly created snap volinfo - * before storing and generating the brick volfiles. + * before storing and generating the brick volfiles. Also update + * the snap vol's version after removing the barrier key. */ dict_del (snap_vol->dict, "features.barrier"); + gd_update_volume_op_versions (snap_vol); ret = glusterd_store_volinfo (snap_vol, GLUSTERD_VOLINFO_VER_AC_INCREMENT); diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 216dff6e737..07ff79f6e53 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -571,7 +571,7 @@ glusterd_volinfo_dup (glusterd_volinfo_t *volinfo, dict_copy (volinfo->dict, new_volinfo->dict); dict_copy (volinfo->gsync_slaves, new_volinfo->gsync_slaves); - gd_update_volume_op_versions (new_volinfo); + new_volinfo->op_version = volinfo->op_version; if (set_userauth) { glusterd_auth_set_username (new_volinfo, -- cgit