summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2007-07-02 23:35:08 +0200
committerKarel Zak2007-07-02 23:35:08 +0200
commit2e039577c5eb895fab35aed136345a0c07d7a587 (patch)
tree73feea7794e3472e79918d24a8513a4d2ef5ead2
parentbuild-sys: fix linking when ncurses is built with --with-termlib=tinfo (diff)
downloadkernel-qcow2-util-linux-2e039577c5eb895fab35aed136345a0c07d7a587.tar.gz
kernel-qcow2-util-linux-2e039577c5eb895fab35aed136345a0c07d7a587.tar.xz
kernel-qcow2-util-linux-2e039577c5eb895fab35aed136345a0c07d7a587.zip
mount: use loop= option when mounting by /sbin/mount.<type>
The mount(8) calls external mount programs (/sbin/mount.<type>) without the loop=/dev/loopN option. This patch fix this bug. Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--mount/mount.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mount/mount.c b/mount/mount.c
index c27c5e56a..50089a9ac 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -1057,6 +1057,9 @@ try_mount_one (const char *spec0, const char *node0, const char *types0,
goto out;
}
+ if (loop)
+ opt_loopdev = loopdev;
+
/*
* Call mount.TYPE for types that require a separate mount program.
* For the moment these types are ncpfs and smbfs. Maybe also vxfs.
@@ -1082,8 +1085,6 @@ try_mount_one (const char *spec0, const char *node0, const char *types0,
if (fake || mnt5_res == 0) {
/* Mount succeeded, report this (if verbose) and write mtab entry. */
- if (loop)
- opt_loopdev = loopdev;
if (!(mounttype & MS_PROPAGATION)) {
update_mtab_entry(loop ? loopfile : spec,