summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSachin Pandit <spandit@redhat.com>2014-03-17 09:42:16 +0530
committerRajesh Joseph <rjoseph@redhat.com>2014-03-17 23:42:24 -0700
commite481921863d91dfce5550ce9722e99129f5979c2 (patch)
treea0ca6886b5b08807bdadc3c1017419f2d9e25d3e
parentbc8a9a21f8e3184b2138be3ca10280dfde3ce153 (diff)
glusterd/snapshot : Restore fix.
Copy the snapshot present in origin volume to the restored volume. Change-Id: Icea9f712ae062b50b570d27b85cd231903446198 BUG: 1077142 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7282 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c7
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 24a70eb..4c4dbd7 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -4127,6 +4127,8 @@ gd_restore_snap_volume (glusterd_volinfo_t *orig_vol,
glusterd_snap_t *snap = NULL;
xlator_t *this = NULL;
glusterd_conf_t *conf = NULL;
+ glusterd_volinfo_t *temp_volinfo = NULL;
+ glusterd_volinfo_t *voliter = NULL;
this = THIS;
GF_ASSERT (this);
@@ -4162,6 +4164,11 @@ gd_restore_snap_volume (glusterd_volinfo_t *orig_vol,
new_volinfo->snap_max_hard_limit = orig_vol->snap_max_hard_limit;
new_volinfo->is_volume_restored = _gf_true;
+ list_for_each_entry_safe (voliter, temp_volinfo,
+ &orig_vol->snap_volumes, snapvol_list) {
+ list_add_tail (&voliter->snapvol_list,
+ &new_volinfo->snap_volumes);
+ }
/* Copy the snap vol info to the new_volinfo.*/
ret = glusterd_snap_volinfo_restore (new_volinfo, snap_vol);
if (ret) {
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index bcc376a..7e065b7 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -306,6 +306,9 @@ struct glusterd_volinfo_ {
glusterd_volinfo_t->snap_volumes */
struct list_head bricks;
struct list_head snap_volumes;
+ /* TODO : Need to remove this, as this
+ * is already part of snapshot object.
+ */
glusterd_volume_status status;
int sub_count; /* backward compatibility */
int stripe_count;