summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.c
diff options
context:
space:
mode:
authorVijaikumar M <vmallika@redhat.com>2014-02-13 16:32:12 +0530
committerRajesh Joseph <rjoseph@redhat.com>2014-02-13 06:18:15 -0800
commit96f6c5159da92500e8ddb21a487d2848a2b1f7db (patch)
tree173aadb72ff76d27ef6589a2ed1eed5c5220abff /xlators/mgmt/glusterd/src/glusterd-store.c
parenta6351ee1c823a295f592f4adf5876a6166d47afe (diff)
glusterd/snapshot: Use snap uuid to create lvm snapshot
Using snap uuid to create lvm snapshot will solve the problem of having '-' in the snap name or snap name is too long. Change-Id: If204f02a8f5de599fb409d06c7893ef3542a6300 BUG: 1045333 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/6709 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index 56a64145c..c02c2c690 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -1444,7 +1444,7 @@ glusterd_store_snap_volume (glusterd_volinfo_t *volinfo, glusterd_snap_t *snap)
goto unlock;
ret = glusterd_store_create_snap_vol_dir (volinfo,
- snap->snap_name);
+ snap_volinfo->volname);
if (ret) {
gf_log (THIS->name, GF_LOG_ERROR,
"Failed create snapshot dir (%s) for volume "
@@ -2843,7 +2843,7 @@ glusterd_store_update_volinfo (glusterd_volinfo_t *volinfo,
goto out;
}
- GLUSTERD_GET_SNAP_DIR (volpath, parent_vol, snap->snap_name,
+ GLUSTERD_GET_SNAP_DIR (volpath, parent_vol, volinfo->volname,
conf);
} else {
GLUSTERD_GET_VOLUME_DIR(volpath, volinfo, conf);
@@ -3075,8 +3075,10 @@ glusterd_store_retrieve_volume (char *volname, glusterd_snap_t *snap)
ret = glusterd_volinfo_find (volname, &parent_vol);
if (ret)
goto out;
- strncpy (volinfo->volname, snap->snap_name, GLUSTERD_MAX_VOLUME_NAME);
- GLUSTERD_GET_SNAP_DIR (volpath, parent_vol, snap->snap_name, priv);
+ GLUSTERD_GET_UUID_NOHYPHEN(volinfo->volname,
+ snap->snap_id);
+ GLUSTERD_GET_SNAP_DIR (volpath, parent_vol, volinfo->volname,
+ priv);
strncpy (volinfo->parent_volname, volname, GLUSTERD_MAX_VOLUME_NAME);
} else {
strncpy (volinfo->volname, volname, GLUSTERD_MAX_VOLUME_NAME);