summaryrefslogtreecommitdiffstats
path: root/libmount/src/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmount/src/context.c')
-rw-r--r--libmount/src/context.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c
index 594f090f4..571a2496a 100644
--- a/libmount/src/context.c
+++ b/libmount/src/context.c
@@ -1001,7 +1001,18 @@ int mnt_context_set_mflags(struct libmnt_context *cxt, unsigned long flags)
{
if (!cxt)
return -EINVAL;
+
cxt->mountflags = flags;
+
+ if ((cxt->flags & MNT_FL_MOUNTOPTS_FIXED) && cxt->fs)
+ /*
+ * the final mount options are already generated, refresh...
+ */
+ return mnt_optstr_apply_flags(
+ &cxt->fs->vfs_optstr,
+ cxt->mountflags,
+ mnt_get_builtin_optmap(MNT_LINUX_MAP));
+
return 0;
}