diff options
author | Karel Zak | 2014-06-17 15:38:14 +0200 |
---|---|---|
committer | Karel Zak | 2014-06-17 15:38:14 +0200 |
commit | 150e696dacafb2a2583e9c5dae736480b84d6673 (patch) | |
tree | 8890391f877566548b9648ca71cd8e2b4058da42 /libmount/src/context_umount.c | |
parent | tests: remove test_wholedisk (diff) | |
download | kernel-qcow2-util-linux-150e696dacafb2a2583e9c5dae736480b84d6673.tar.gz kernel-qcow2-util-linux-150e696dacafb2a2583e9c5dae736480b84d6673.tar.xz kernel-qcow2-util-linux-150e696dacafb2a2583e9c5dae736480b84d6673.zip |
libmount: don't touch mtab when mount -n specified
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1109367
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context_umount.c')
-rw-r--r-- | libmount/src/context_umount.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c index 7df4c2cca..220f28bc6 100644 --- a/libmount/src/context_umount.c +++ b/libmount/src/context_umount.c @@ -92,7 +92,7 @@ int mnt_context_find_umount_fs(struct libmnt_context *cxt, * where LABEL, UUID or symlinks are canonicalized. It means that * it's usable only for canonicalized stuff (e.g. kernel mountinfo). */ - if (!cxt->mtab_writable && *tgt == '/' && + if (!mnt_context_mtab_writable(cxt) && *tgt == '/' && !mnt_context_is_force(cxt) && !mnt_context_is_lazy(cxt)) { struct stat st; @@ -259,7 +259,7 @@ static int lookup_umount_fs(struct libmnt_context *cxt) if (!mnt_context_is_restricted(cxt) && *tgt == '/' && !(cxt->flags & MNT_FL_HELPER) - && !cxt->mtab_writable + && !mnt_context_mtab_writable(cxt) && !mnt_context_is_force(cxt) && !mnt_context_is_lazy(cxt) && stat(tgt, &st) == 0 && S_ISDIR(st.st_mode) @@ -267,7 +267,7 @@ static int lookup_umount_fs(struct libmnt_context *cxt) const char *type = mnt_fs_get_fstype(cxt->fs); - /* !cxt->mtab_writable && has_utab_entry() verified that there + /* !mnt_context_mtab_writable(cxt) && has_utab_entry() verified that there * is no stuff in utab, so disable all mtab/utab related actions */ mnt_context_disable_mtab(cxt, TRUE); @@ -865,7 +865,7 @@ int mnt_context_do_umount(struct libmnt_context *cxt) && (cxt->mountflags & MS_REMOUNT)) { /* use "remount" instead of "umount" in /etc/mtab */ - if (!rc && cxt->update && cxt->mtab_writable) + if (!rc && cxt->update && mnt_context_mtab_writable(cxt)) rc = mnt_update_set_fs(cxt->update, cxt->mountflags, NULL, cxt->fs); } |