From e39cbb76033e689093da42453839afa9c8d4c8e5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 17 Jul 2012 21:57:22 +0200 Subject: 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 --- libmount/src/context_umount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmount/src/context_umount.c') 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); -- cgit v1.2.3-55-g7522