From dc4dbbf188be91da4b13b29e04ae94f2f831e4ab Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 13 Jan 2012 16:27:50 +0100 Subject: libmount: allow to toggle ro/rw and mount again Signed-off-by: Karel Zak --- libmount/src/context_mount.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libmount/src/context_mount.c') diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index bb895425f..6f2a3dc11 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -39,7 +39,7 @@ static int fix_optstr(struct libmnt_context *cxt) if (!cxt) return -EINVAL; - if (!cxt->fs) + if (!cxt->fs || (cxt->flags & MNT_FL_MOUNTOPTS_FIXED)) return 0; DBG(CXT, mnt_debug_h(cxt, "mount: fixing optstr")); @@ -133,6 +133,8 @@ static int fix_optstr(struct libmnt_context *cxt) fs->optstr = NULL; fs->optstr = mnt_fs_strdup_options(fs); done: + cxt->flags |= MNT_FL_MOUNTOPTS_FIXED; + DBG(CXT, mnt_debug_h(cxt, "fixed options [rc=%d]: " "vfs: '%s' fs: '%s' user: '%s', optstr: '%s'", rc, fs->vfs_optstr, fs->fs_optstr, fs->user_optstr, fs->optstr)); -- cgit v1.2.3-55-g7522