diff options
author | Karel Zak | 2015-02-16 13:38:07 +0100 |
---|---|---|
committer | Karel Zak | 2015-02-16 13:39:33 +0100 |
commit | ff5ace78d6a6f8274e12080cc282c41ad58a0c7f (patch) | |
tree | e541c848af6ddf87d5e2e1d151397861d9e14298 /libmount/src/context.c | |
parent | libmount: add --enable-libmount-force-mountinfo (diff) | |
download | kernel-qcow2-util-linux-ff5ace78d6a6f8274e12080cc282c41ad58a0c7f.tar.gz kernel-qcow2-util-linux-ff5ace78d6a6f8274e12080cc282c41ad58a0c7f.tar.xz kernel-qcow2-util-linux-ff5ace78d6a6f8274e12080cc282c41ad58a0c7f.zip |
libmount: improve remount logic
* fix fs type detection for remount
* parse mtab only for remount and umount
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context.c')
-rw-r--r-- | libmount/src/context.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c index 0fb9f6f80..d9391dd6b 100644 --- a/libmount/src/context.c +++ b/libmount/src/context.c @@ -1699,6 +1699,8 @@ int mnt_context_guess_fstype(struct libmnt_context *cxt) assert(cxt->fs); assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED)); + DBG(CXT, ul_debugobj(cxt, "preparing fstype")); + if (!cxt || !cxt->fs) return -EINVAL; @@ -1714,7 +1716,7 @@ int mnt_context_guess_fstype(struct libmnt_context *cxt) if (type) goto done; - if (cxt->flags & MS_REMOUNT) + if (cxt->mountflags & MS_REMOUNT) goto none; if (cxt->fstype_pattern) goto done; @@ -2100,7 +2102,8 @@ int mnt_context_apply_fstab(struct libmnt_context *cxt) } /* try mtab */ - if (rc < 0 && (cxt->optsmode & MNT_OMODE_MTAB)) { + if (rc < 0 && (cxt->optsmode & MNT_OMODE_MTAB) + && (isremount || cxt->action == MNT_ACT_UMOUNT)) { DBG(CXT, ul_debugobj(cxt, "trying to apply mtab (src=%s, target=%s)", src, tgt)); if (tgt) rc = mnt_context_get_mtab_for_target(cxt, &tab, tgt); |