Re: Another loop device bug (2.0)

Shinanyaku (shin@binary9.net)
Fri, 21 Jun 1996 18:32:40 -0400 (EDT)


Bruce Elliott was heard saying ....
>

Yep, it fixed it fine on my system:

neko:...homes/nicholas > cat test
#!/bin/sh

dev=/dev/loop0
img=/tmp/image
mnt=/mnt
taz=/usr/homes/nicholas/Computer/source/kernel/linux-2.0.tar.gz

dd bs=1k count=32k if=/dev/zero of=$img
losetup $dev $img
mke2fs -m0 $dev
mount $dev $mnt
cd $mnt
tar xfz $taz
cd /
umount $mnt
fsck -f -y $dev
losetup -d $dev
rm -f $img
neko:...homes/nicholas > su
Password:
# sh test
32768+0 records in
32768+0 records out
mke2fs 0.5b, 11-Mar-95 for EXT2 FS 0.5b, 95/08/09
8192 inodes, 32768 blocks
0 blocks (0.00%) reserved for the super user
First data block=1
Block size=1024 (log=0)
Fragment size=1024 (log=0)
4 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
8193, 16385, 24577

Writing inode tables: done
Writing superblocks and filesystem accounting information: done
Parallelizing fsck version 0.5b (11-Mar-95)
e2fsck 0.5b, 11-Mar-95 for EXT2 FS 0.5b, 95/08/09
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/loop0: 2147/8192 files, 24430/32768 blocks

> The included patch seems to fix this. It has been tested by copying a
> filesystem of 370 MB and about 20000 files. The filesystem was then
> unmounted, remounted (again through the loop device), and all files
> matched with "cmp".
>
> ========================================================================
> --- linux/drivers/block/loop.c.orig Sun May 5 21:28:51 1996
> +++ linux/drivers/block/loop.c Thu Jun 20 00:29:45 1996
> @@ -225,8 +225,10 @@
> brelse(bh);
> goto error_out;
> }
> - if (CURRENT->cmd == WRITE)
> + if (CURRENT->cmd == WRITE) {
> + mark_buffer_uptodate(bh, 1);
> mark_buffer_dirty(bh, 1);
> + }
> brelse(bh);
> dest_addr += size;
> len -= size;
> ========================================================================
>
> B. D. Elliott bde@accessone.com (Seattle)
>
>

Shin!
__________________________________________________________________________
Another Mailing List personality of Nicholas J. Leon shin@binary9.net

[ http://www.binary9.net/nicholas/ ]