From 96f6c5159da92500e8ddb21a487d2848a2b1f7db Mon Sep 17 00:00:00 2001 From: Vijaikumar M Date: Thu, 13 Feb 2014 16:32:12 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/6709 Reviewed-by: Rajesh Joseph Tested-by: Rajesh Joseph --- xlators/mgmt/glusterd/src/glusterd-store.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c') 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); -- cgit