Bug: loop-mount + sparse files

Gunther Mayer (gunther.mayer@braunschweig.netsurf.de)
Sun, 08 Dec 1996 15:53:14 +0100


this is a bugreport for linux-2.1.10 (others not yet tested):
"loop mounting of an iso-image on an ext2-filesystem doesn't
work for sparse files".

(sparse means a file containing a block full of nullbytes,
ext2 has the capabilty to store such blocks without using diskspace.)

DETAILS (How to reproduce)
mkdir looptest
dd if=/dev/zero of=looptest/testfile bs=1024 count=100
echo Hi > looptest/hi
mkisofs looptest >looptest.iso # this is not yet a sparse file
cp looptest.iso looptest-cp.iso # cp knows how to create sparse files!
mount -o loop -t iso9660 looptest-cp.iso /mnt
strace cp /mnt/testfile /dev/null # this shows EIO on first read()
# syslog shows "loop: block 63 not present" and
so on.
strace cat /mnt/hi # even this produces these errors!
# the original file "looptest.iso" works OK; when you copy either image
# to a FAT partition it will work OK (DOS doesn't know about sparse

linux/drivers/block/loop.c returns an error if it discovers such a
block (because it can't bmap it).

Either document this behaviour or correct it:-)

Sincerly, Gunther