mount: don't use auto-clear loopdev if mtab is available
# mount /home/images/floppy.img /mnt/test2
# mount | grep loop
/dev/loop0 on /mnt/test2 type udf (rw)
mount(8) with auto-clear loopdev does not store information about the
original backing file (the image) to /etc/mtab. (Note that this is our
long-term goal, because we want to remove mtab from Linux.)
Unfortunately, losetup(8) is not able to provide full path for the
backing file, because LOOP_GET_STATUS ioctl uses 64 bytes for the
filename...
So, without the information about the backing file in mtab the
information about mapping between the file and the loopdev is
unaccessible from userspace.
From my point of view it would be nice to add all necessary
information about loopdevs to /sys rather than rely on broken
LOOP_GET_STATUS[64] ioctls.
with this patch:
# mount /home/images/floppy.img /mnt/test2
# mount | grep loop# mount | grep loop
/home/images/floppy.img on /mnt/test2 type udf (ro,loop=/dev/loop0)
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=615389 Signed-off-by: Karel Zak <kzak@redhat.com>