* util-linux-2.22 regression on umount with loop and /etc/mtab real file
[not found] <1621495890.210163275.1347911558877.JavaMail.root@zimbra33-e6.priv.proxad.net>
@ 2012-09-18 5:50 ` g.esp
2012-09-18 9:29 ` Karel Zak
0 siblings, 1 reply; 3+ messages in thread
From: g.esp @ 2012-09-18 5:50 UTC (permalink / raw)
To: util-linux
I find that some coreutils(-8.19) tests using mount -oloop fail to remove the loop when the fs is unmounted after util-linux-2.22 upgrade.
How to reproduce
[chroot-i486] root:/$ mount --version
mount from util-linux 2.21.2 (with libblkid support)
[chroot-i486] root:/$ dd if=/dev/zero of=/tmp/foo_fs bs=8192 count=200 &>/dev/null
[chroot-i486] root:/$ mkfs -t ext2 -F /tmp/foo_fs &>/dev/null
[chroot-i486] root:/$ mkdir /tmp/bar_dir
[chroot-i486] root:/$ mount -oloop /tmp/foo_fs /tmp/bar_dir
[chroot-i486] root:/$ losetup -a
/dev/loop0: [2051]:366712 (/tmp/foo_fs)
[chroot-i486] root:/$ umount /tmp/foo_fs
[chroot-i486] root:/$ losetup -a
The loop is cleaned on umount with 2.21.2
With 2.22, unmounting /tmp/foo_fs no more remove the loop
[chroot-i486] root:/$ mount --version
mount from util-linux 2.22 (libmount 2.22.0: debug)
[chroot-i486] root:/$ losetup -a
[chroot-i486] root:/$ mount -oloop /tmp/foo_fs /tmp/bar_dir
[chroot-i486] root:/$ umount /tmp/foo_fs
[chroot-i486] root:/$ losetup -a
/dev/loop0: [2051]:387175 (/tmp/foo_fs)
The loop remain.
A real /etc/mtab was in use. If using /etc/mtab as a symlink to /proc/mount, the loop disappear on umount.
I am not a strong opponent to /etc/mtab as symlink as I was there a few years back. And I know where the wind is blowing actually.
It's just that issues happen in both cases.
For example, a simple df command inside a chroot report error for mountpoints made outside of the chroot.
Gilles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: util-linux-2.22 regression on umount with loop and /etc/mtab real file
2012-09-18 5:50 ` util-linux-2.22 regression on umount with loop and /etc/mtab real file g.esp
@ 2012-09-18 9:29 ` Karel Zak
2012-09-18 21:31 ` g.esp
0 siblings, 1 reply; 3+ messages in thread
From: Karel Zak @ 2012-09-18 9:29 UTC (permalink / raw)
To: g.esp; +Cc: util-linux
On Tue, Sep 18, 2012 at 07:50:29AM +0200, g.esp@free.fr wrote:
> The loop is cleaned on umount with 2.21.2
> With 2.22, unmounting /tmp/foo_fs no more remove the loop
>
> [chroot-i486] root:/$ mount --version
> mount from util-linux 2.22 (libmount 2.22.0: debug)
> [chroot-i486] root:/$ losetup -a
> [chroot-i486] root:/$ mount -oloop /tmp/foo_fs /tmp/bar_dir
> [chroot-i486] root:/$ umount /tmp/foo_fs
> [chroot-i486] root:/$ losetup -a
> /dev/loop0: [2051]:387175 (/tmp/foo_fs)
>
> The loop remain.
Kernel version? I guess something old... :-)
Since kernel 2.6.37 we use autoclear flag:
$ cat /sys/block/loop0/loop/autoclear
1
if the flags is enabled (should be always by mount(8)) then the loop
device is automatically detached by kernel after successful umount(2).
It means that we don't have to store any extra information in
userspace or do any magic around loopdevs in umount(8) command.
I found a bug in libmount umount code, it does not check for the
option "loop" in mtab -- this bug is invisible on systems where
autoclear flags is usable. Fixed. Try the code from upstream tree:
git clone git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
cd util-linux
./autogen.sh
./configure
make mount umount
Note that you can use LIBMOUNT_DEBUG=0xffff env.variable to get more
information from libmount.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: util-linux-2.22 regression on umount with loop and /etc/mtab real file
2012-09-18 9:29 ` Karel Zak
@ 2012-09-18 21:31 ` g.esp
0 siblings, 0 replies; 3+ messages in thread
From: g.esp @ 2012-09-18 21:31 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
----- Mail original -----
> De: "Karel Zak" <kzak@redhat.com>
> =C3=80: "g esp" <g.esp@free.fr>
> Cc: util-linux@vger.kernel.org
> Envoy=C3=A9: Mardi 18 Septembre 2012 11:29:26
> Objet: Re: util-linux-2.22 regression on umount with loop and /etc/mtab r=
eal file
>=20
> On Tue, Sep 18, 2012 at 07:50:29AM +0200, g.esp@free.fr wrote:
> > The loop is cleaned on umount with 2.21.2
> > With 2.22, unmounting /tmp/foo_fs no more remove the loop
> >=20
> > [chroot-i486] root:/$ mount --version
> > mount from util-linux 2.22 (libmount 2.22.0: debug)
> > [chroot-i486] root:/$ losetup -a
> > [chroot-i486] root:/$ mount -oloop /tmp/foo_fs /tmp/bar_dir
> > [chroot-i486] root:/$ umount /tmp/foo_fs
> > [chroot-i486] root:/$ losetup -a
> > /dev/loop0: [2051]:387175 (/tmp/foo_fs)
> >=20
> > The loop remain.
>=20
> Kernel version? I guess something old... :-)
>=20
> Since kernel 2.6.37 we use autoclear flag:
>=20
> $ cat /sys/block/loop0/loop/autoclear
> 1
>=20
The kernel running on the machine is debian v6 (squeeze) 2.6.32, so this is=
not something brand new.
> if the flags is enabled (should be always by mount(8)) then the loop
> device is automatically detached by kernel after successful
> umount(2).
> It means that we don't have to store any extra information in
> userspace or do any magic around loopdevs in umount(8) command.
>=20
>=20
> I found a bug in libmount umount code, it does not check for the
> option "loop" in mtab -- this bug is invisible on systems where
> autoclear flags is usable. Fixed. Try the code from upstream tree:
>=20
Thank, git tree fixed the issue.
Gilles
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-18 21:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1621495890.210163275.1347911558877.JavaMail.root@zimbra33-e6.priv.proxad.net>
2012-09-18 5:50 ` util-linux-2.22 regression on umount with loop and /etc/mtab real file g.esp
2012-09-18 9:29 ` Karel Zak
2012-09-18 21:31 ` g.esp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).