diff options
author | Avra Sengupta <asengupt@redhat.com> | 2013-12-04 04:13:41 +0000 |
---|---|---|
committer | Avra Sengupta <asengupt@redhat.com> | 2013-12-10 23:54:41 +0000 |
commit | dbd515195e5177fe34a12102ba2290cfe2bdc388 (patch) | |
tree | 4dbc2c77447e1015b674e00c6f48b907f7cd941f /xlators/mgmt/glusterd/src/glusterd-snapshot.c | |
parent | db9476c6dd4af75c3f658bc4ee4ce82403eb5fdf (diff) |
glusterd/snapshot: Fix Displaying Port, Online Status and Pid for snap vols in volume status
Added a parent_volname member in glusterd_volinfo_ structure
to help point the snap vol to the parent volname. Using this
to fetch the pidfile location during volume status.
Change-Id: I30a16646561394d0f7d16f66abff14c425f31f06
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 5 |
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 198f64c8b..5ea36dde3 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 */ |