summaryrefslogtreecommitdiffstats
path: root/libmount/src/context_umount.c
diff options
context:
space:
mode:
authorKarel Zak2012-07-17 21:57:22 +0200
committerKarel Zak2012-07-17 21:57:22 +0200
commite39cbb76033e689093da42453839afa9c8d4c8e5 (patch)
treebaaddf234aae42639032f2437a3732aa78bbdad3 /libmount/src/context_umount.c
parentdocs: update TODO file (diff)
downloadkernel-qcow2-util-linux-e39cbb76033e689093da42453839afa9c8d4c8e5.tar.gz
kernel-qcow2-util-linux-e39cbb76033e689093da42453839afa9c8d4c8e5.tar.xz
kernel-qcow2-util-linux-e39cbb76033e689093da42453839afa9c8d4c8e5.zip
libmount: allow to disable swap between source and target
In some cases (for example if only one mount argument is given) may be mount request ambivalent: # mount /foo and fstab: /dev/sda5 /foo rw 0 0 /foo /bar bind 0 0 The libmount allows to swap between source and target (if source is not LABEL or UUID) by default. The new function mnt_context_disable_swapmatch() allows to disable this feature. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context_umount.c')
-rw-r--r--libmount/src/context_umount.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c
index 39d940f6c..2c2975e7e 100644
--- a/libmount/src/context_umount.c
+++ b/libmount/src/context_umount.c
@@ -64,7 +64,7 @@ static int lookup_umount_fs(struct libmnt_context *cxt)
try_loopdev:
fs = mnt_table_find_target(mtab, tgt, MNT_ITER_BACKWARD);
- if (!fs) {
+ if (!fs && mnt_context_is_swapmatch(cxt)) {
/* maybe the option is source rather than target (mountpoint) */
fs = mnt_table_find_source(mtab, tgt, MNT_ITER_BACKWARD);