summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index 198f64c..5ea36dd 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -3037,8 +3037,11 @@ glusterd_do_snap (glusterd_volinfo_t *volinfo, char *snapname, dict_t *dict,
GF_ASSERT (priv);
ret = glusterd_volinfo_dup (volinfo, &snap_volume);
- strcpy (snap_volume->volname, snapname);
+ strncpy (snap_volume->volname, snapname,
+ sizeof(snap_volume->volname) - 1);
snap_volume->is_snap_volume = _gf_true;
+ strncpy (snap_volume->parent_volname, volinfo->volname,
+ sizeof(snap_volume->parent_volname) - 1);
uuid_copy (snap_volume->volume_id, snap_volid);
/* Adding snap brickinfos to the snap volinfo */