summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2014-07-09 09:40:42 +0000
committerKrishnan Parthasarathi <kparthas@redhat.com>2014-07-14 05:30:42 -0700
commit23455c034a95df2be900f0f83515f2a22c5dea8e (patch)
treefaea438209b1075b76d2db35af5e936c66143e19
parent656e6b38189d14c440a46d4d69b5ddfc5d8cfffc (diff)
glusterd/snapshot: Update fstype for local bricks only
While creating snapshot, update fstype for local bricks only and not for bricks hosted on other nodes Also returning ret as 0, in case no cleanup is required in post-validation, so that a post-validation failure is not logged, every time a pre-validation failure happens. Change-Id: I6364e33cfd9528e0a988ee48f3443239ee884336 BUG: 1111060 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/8272 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index dccf57f7c93..cd0d3eb26eb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -3926,17 +3926,22 @@ glusterd_add_brick_to_snap_volume (dict_t *dict, dict_t *rsp_dict,
goto out;
}
- /* Update the backend file-system type of snap brick in
- * snap volinfo. */
- ret = glusterd_update_fstype (original_brickinfo->path, snap_brickinfo,
- original_brickinfo->fstype,
- sizeof(original_brickinfo->fstype));
- if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "Failed to update "
- "file-system type for %s brick",
- snap_brickinfo->path);
- /* We should not fail snapshot operation if we fail to get
- * the file-system type */
+ /* Update fstype for the local bricks only */
+ if (!uuid_compare (original_brickinfo->uuid, MY_UUID)) {
+ /* Update the backend file-system type of snap brick in
+ * snap volinfo. */
+ ret = glusterd_update_fstype
+ (original_brickinfo->path,
+ snap_brickinfo,
+ original_brickinfo->fstype,
+ sizeof(original_brickinfo->fstype));
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR, "Failed to update "
+ "file-system type for %s brick",
+ snap_brickinfo->path);
+ /* We should not fail snapshot operation if we fail to
+ * get the file-system type */
+ }
}
snprintf (key, sizeof(key) - 1, "vol%"PRId64".brickdir%d", volcount,
@@ -6400,6 +6405,7 @@ glusterd_snapshot_create_postvalidate (dict_t *dict, int32_t op_ret,
if (ret) {
gf_log (this->name, GF_LOG_WARNING, "cleanup "
"operation failed");
+ goto out;
}
}
/* Irrespective of status of cleanup its better
@@ -6407,6 +6413,7 @@ glusterd_snapshot_create_postvalidate (dict_t *dict, int32_t op_ret,
* following this block is not required to be
* executed in case of failure scenario.
*/
+ ret = 0;
goto out;
}