From ef32f3059b9dae18f9e76e0385eb01674dc6b94e Mon Sep 17 00:00:00 2001 From: Vijaikumar M Date: Thu, 27 Mar 2014 13:44:56 +0530 Subject: glusterd/snapshot:store related fix for the review comments in the upstream Change-Id: I07da1f0a102b71c7c70dac83b1fe98d05607cb64 Signed-off-by: Vijaikumar M Reviewed-on: http://review.gluster.org/7355 Reviewed-by: Rajesh Joseph Tested-by: Rajesh Joseph --- tests/snapshot.rc | 2 ++ xlators/mgmt/glusterd/src/glusterd-store.c | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/snapshot.rc b/tests/snapshot.rc index 20bddcf0f..a5b86f674 100755 --- a/tests/snapshot.rc +++ b/tests/snapshot.rc @@ -54,6 +54,8 @@ function setup_lvm() { function cleanup_lvm() { pkill gluster + sleep 2 + if [ "$LVM_DEFINED" = "1" ]; then _cleanup_lvm fi diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 944652bd8..70b24aa81 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -666,8 +666,7 @@ glusterd_store_create_snap_dir (glusterd_snap_t *snap) GF_ASSERT (priv); GF_ASSERT (snap); - snprintf (snapdirpath, PATH_MAX, "%s/snaps/%s", priv->workdir, - snap->snapname); + GLUSTERD_GET_SNAP_DIR (snapdirpath, snap, priv); ret = mkdir_p (snapdirpath, 0755, _gf_true); if (ret) { @@ -981,8 +980,8 @@ glusterd_store_node_state_write (int fd, glusterd_volinfo_t *volinfo) GF_ASSERT (volinfo); if (volinfo->rebal.defrag_cmd == GF_DEFRAG_CMD_STATUS) { - ret = 0; - goto out; + ret = 0; + goto out; } snprintf (buf, sizeof (buf), "%d", volinfo->rebal.defrag_cmd); @@ -1396,6 +1395,8 @@ out: return ret; } +/*TODO: cleanup the duplicate code and implement a generic function for + * deleting snap/volume depending on the parameter flag */ int32_t glusterd_store_delete_snap (glusterd_snap_t *snap) { @@ -1657,7 +1658,8 @@ out: } int -glusterd_retrieve_sys_snap_max_limit (xlator_t *this, uint64_t *limit, char *key) +glusterd_retrieve_sys_snap_max_limit (xlator_t *this, uint64_t *limit, + char *key) { char *limit_str = NULL; glusterd_conf_t *priv = NULL; @@ -2174,7 +2176,7 @@ glusterd_store_update_volinfo (glusterd_volinfo_t *volinfo, ret = gf_store_handle_retrieve (path, &volinfo->shandle); if (ret) { - gf_log (this->name, GF_LOG_ERROR, "snap handle is NULL"); + gf_log (this->name, GF_LOG_ERROR, "volinfo handle is NULL"); goto out; } -- cgit