summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
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;
+}
+