summaryrefslogtreecommitdiffstats
path: root/libmount/src/context.c
diff options
context:
space:
mode:
authorFridolin Pokorny2015-02-06 15:55:21 +0100
committerKarel Zak2015-02-10 11:18:51 +0100
commit6f41c5de40629c71a8f79e9be4b94f9a75f9ad21 (patch)
tree86531399846dad38384e08fe07c9e5178f2feeaf /libmount/src/context.c
parentdocs: fix two paths of the v2.20-ReleaseNotes (diff)
downloadkernel-qcow2-util-linux-6f41c5de40629c71a8f79e9be4b94f9a75f9ad21.tar.gz
kernel-qcow2-util-linux-6f41c5de40629c71a8f79e9be4b94f9a75f9ad21.tar.xz
kernel-qcow2-util-linux-6f41c5de40629c71a8f79e9be4b94f9a75f9ad21.zip
libmount: MNT_OMODE_FORCE usage
Hi, I have found out that libmount does not respect MNT_OMODE_FORCE mode. I don't see any usage in sources and libmount does not respect this mode when calling library functions. I'm proposing a patch to fix this. Have a nice day! Fridolin Pokorny
Diffstat (limited to 'libmount/src/context.c')
-rw-r--r--libmount/src/context.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmount/src/context.c b/libmount/src/context.c
index c902f396e..1c288e550 100644
--- a/libmount/src/context.c
+++ b/libmount/src/context.c
@@ -2077,6 +2077,7 @@ int mnt_context_apply_fstab(struct libmnt_context *cxt)
}
if (!src && tgt
+ && !(cxt->optsmode & MNT_OMODE_FORCE)
&& !(cxt->optsmode & MNT_OMODE_FSTAB)
&& !(cxt->optsmode & MNT_OMODE_MTAB)) {
DBG(CXT, ul_debugobj(cxt, "only target; fstab/mtab not required "
@@ -2088,7 +2089,7 @@ int mnt_context_apply_fstab(struct libmnt_context *cxt)
ignore_result( mnt_context_get_fs(cxt) );
/* try fstab */
- if (cxt->optsmode & MNT_OMODE_FSTAB) {
+ if (cxt->optsmode & (MNT_OMODE_FSTAB | MNT_OMODE_FORCE)) {
DBG(CXT, ul_debugobj(cxt, "trying to apply fstab (src=%s, target=%s)", src, tgt));
rc = mnt_context_get_fstab(cxt, &tab);
if (!rc)
@@ -2096,7 +2097,7 @@ 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 | MNT_OMODE_FORCE))) {
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);