Flushing of loopback device

Han Holl (jeholl@euronet.nl)
Mon, 26 Feb 1996 22:11:53 +0100


Kernel 1.3.68.
Got a problem with the loopback device:

Here's a simple script:
/tmp>cat problem
#!/bin/bash

size=2000
tmfile=/tmp/crtemp

rm -f $tmfile
dd if=/dev/zero of=$tmfile bs=1k count=$size
mke2fs -F $tmfile $size
mount -t lo@/dev/loop0 $tmfile /mnt -o vfs=ext2
cd /etc ; find . | cpio -pumd /mnt
umount /mnt
e2fsck -f $tmfile

If I run it, I get:
/tmp>./problem
2000+0 records in
2000+0 records out
mke2fs 1.02, 16-Jan-96 for EXT2 FS 0.5a, 95/03/19
504 inodes, 2000 blocks
100 blocks (5.00%) reserved for the super user
First data block=1
Block size=1024 (log=0)
Fragment size=1024 (log=0)
1 block group
8192 blocks per group, 8192 fragments per group
504 inodes per group

Writing inode tables: done
Writing superblocks and filesystem accounting information: done
808 blocks
e2fsck 1.02, 16-Jan-96 for EXT2 FS 0.5a, 95/03/19
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Entry '..' in ??? (26) has deleted/unused inode 22.
Clear<y>?

It looks like there is a flushing problem with the loopback device.
(Or I'm doing something terribly wrong; I tried adding sleeps before and
after the umount, but nothing seems to help).

Han Holl