diff options
author | Rajesh Joseph <rjoseph@redhat.com> | 2014-07-01 20:25:04 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-07-03 06:53:12 -0700 |
commit | dedef037d64fef59d74b9861562aa7f93857a53e (patch) | |
tree | e3ed0c288cfac75f0ece3f10a64bfa63bbb9a431 /xlators/mgmt/glusterd/src/glusterd-store.c | |
parent | 3df72ddcdb371c441b5535ad802fc59a794e3ac9 (diff) |
glusterd/snapshot: Change file-system uuid to file-system label
Problem: In XFS changing file-system UUID with xfs_admin is causing
too much delay with large file-system. The time taken by xfs_admin
tool to change UUID is directly proportional to the size of the file
system.
Cause: In XFS file-system UUID is stored in file-system superblock.
Therefore for chaning UUID all the superblock needs to be changed.
Fix: Instead of using file-system UUID use file-system label.
Change-Id: Ifb4c668fb29cfc1c89d9b221abc8d09dc09589ec
BUG: 1115107
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-on: http://review.gluster.org/8215
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index e03ec7af9f5..c31d8a8ad71 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -325,6 +325,17 @@ gd_store_brick_snap_details_write (int fd, glusterd_brickinfo_t *brickinfo) goto out; } + if (strlen (brickinfo->fstype) > 0) { + snprintf (value, sizeof (value), "%s", brickinfo->fstype); + ret = gf_store_save_value (fd, + GLUSTERD_STORE_KEY_BRICK_FSTYPE, value); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, "Failed to save " + "brick fs type of brick %s", brickinfo->path); + goto out; + } + } + memset (value, 0, sizeof (value)); snprintf (value, sizeof(value), "%d", brickinfo->snap_status); ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_BRICK_SNAP_STATUS, @@ -2272,6 +2283,10 @@ glusterd_store_retrieve_bricks (glusterd_volinfo_t *volinfo) } else if (!strncmp (key, GLUSTERD_STORE_KEY_BRICK_SNAP_STATUS, strlen (GLUSTERD_STORE_KEY_BRICK_SNAP_STATUS))) { gf_string2int (value, &brickinfo->snap_status); + } else if (!strncmp (key, GLUSTERD_STORE_KEY_BRICK_FSTYPE, + strlen (GLUSTERD_STORE_KEY_BRICK_FSTYPE))) { + strncpy (brickinfo->fstype, value, + sizeof (brickinfo->fstype)); } else if (!strncmp (key, GLUSTERD_STORE_KEY_BRICK_VGNAME, strlen (GLUSTERD_STORE_KEY_BRICK_VGNAME))) { @@ -3086,7 +3101,8 @@ out: * at the brick_mount_path */ int32_t -glusterd_mount_brick_paths (char *brick_mount_path, char *device_path) +glusterd_mount_brick_paths (char *brick_mount_path, char *device_path, + const char *fstype) { int32_t ret = -1; runner_t runner = {0, }; @@ -3134,7 +3150,8 @@ glusterd_mount_brick_paths (char *brick_mount_path, char *device_path) "Activating %s successful", device_path); /* Mount the snapshot */ - ret = glusterd_mount_lvm_snapshot (device_path, brick_mount_path); + ret = glusterd_mount_lvm_snapshot (device_path, brick_mount_path, + fstype); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Failed to mount lvm snapshot."); @@ -3208,7 +3225,7 @@ glusterd_recreate_vol_brick_mounts (xlator_t *this, /* Check if brick_mount_path is already mounted. * If not, mount the device_path at the brick_mount_path */ ret = glusterd_mount_brick_paths (brick_mount_path, - brickinfo->device_path); + brickinfo->device_path, brickinfo->fstype); if (ret) { gf_log (this->name, GF_LOG_ERROR, "Failed to mount brick_mount_path"); |