]> git.ipfire.org Git - thirdparty/util-linux.git/commit
umount: allow unmounting loopdev specified by associated file
authorPetr Uzel <petr.uzel@suse.cz>
Thu, 17 Feb 2011 11:52:43 +0000 (12:52 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 18 Apr 2011 12:32:39 +0000 (14:32 +0200)
commit33cee6675edecbd27c0628f8b7c74c7d88fc02b2
tree21dacfab63fd2b9b61eedce38bf12486c5ac8afd
parentfde25e6be6e00a0998eb58b4b9d0d0b9ad65dbfd
umount: allow unmounting loopdev specified by associated file

Make it possible to unmount a filesystem on a loop device if it is
specified by associated backing file. It does not attempt to unmount
anything if there are more than one loop device associated with the
given file.

Umount looks for associated loopdevice(s) only if umount is called
with the regular file as an argument.

Before:
mount -o loop -t ext2 img mnt
umount -v img
> Could not find /home/puzel/upstream/util-linux/img in mtab
> umount: img: not mounted

After:
mount -o loop -t ext2 img mnt
umount -v img
> img is associated with /dev/loop0, trying to unmount it
> /dev/loop0 has been unmounted

[kzak@redhat.com: - fix memory leak in lomount.c]

Addresses: https://bugzilla.novell.com/show_bug.cgi?id=666161
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
mount/lomount.c
mount/lomount.h
mount/umount.c