summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2014-11-13 07:11:00 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2014-11-13 20:10:02 -0800
commitf3f7f2a2048359db67875a54a96dbf5a46f7bff3 (patch)
tree6fa18454979a181d0dc6a2ee1fb7588c60f414b5 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent878b30420891c8b00043391cdce90930eaf18795 (diff)
glusterd/snapshot: Don't append nouuid mount option for snapshot brick
if original brick already has this option Change-Id: I2841d2ac371a3e9505f6061f35d1d447946c0bae BUG: 1133456 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/8526 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 678405de241..b5128aa6426 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -12106,7 +12106,8 @@ glusterd_mount_lvm_snapshot (glusterd_brickinfo_t *brickinfo,
* Therefore to mount such a snapshot in XFS we need to pass nouuid
* option
*/
- if (!strcmp (brickinfo->fstype, "xfs")) {
+ if (!strcmp (brickinfo->fstype, "xfs") &&
+ !mntopts_exists (mnt_opts, "nouuid")) {
if ( strlen (mnt_opts) > 0 )
strcat (mnt_opts, ",");
strcat (mnt_opts, "nouuid");
@@ -14003,3 +14004,35 @@ glusterd_op_clear_xaction_peers ()
}
}
+
+gf_boolean_t
+mntopts_exists (const char *str, const char *opts)
+{
+ char *dup_val = NULL;
+ char *savetok = NULL;
+ char *token = NULL;
+ gf_boolean_t exists = _gf_false;
+
+ GF_ASSERT (opts);
+
+ if (!str || !strlen(str))
+ goto out;
+
+ dup_val = gf_strdup (str);
+ if (!dup_val)
+ goto out;
+
+ token = strtok_r (dup_val, ",", &savetok);
+ while (token) {
+ if (!strcmp (token, opts)) {
+ exists = _gf_true;
+ goto out;
+ }
+ token = strtok_r (NULL, ",", &savetok);
+ }
+
+out:
+ GF_FREE (dup_val);
+ return exists;
+}
+