Re: [ext2resize] Patches for ext2resize?
Status: Inactive
Brought to you by:
adilger
From: Takashi S. <sh...@tn...> - 2006-06-23 13:01:15
|
Hi, > >> I found a bug in my patch which you applied to CVS. > > If I understand you correctly, you suggest this change. How can I > test if the change work or not? How can I reproduce the error it is > fixing? This change works only when ext2prepare adds reserved group descriptor blocks. This is reproduced by the following procedure. #mke2fs /dev/XXX -j -b 16384 3294967295 #ext2prepare /dev/XXX 4294967295 In case 4KB blocksize, this problem doesn't occur because fs->sb.s_blocks_per_group is set to 32768, which is a multiple of 1024(fs->u32perblock), and both the following two cases give the same result. > - if(((block - gdb_offset)%fs->u32perblock) != i) > + if(((block - gdb_offset)%fs->sb.s_blocks_per_group) != i) While in case 16KB blocksize, fs->sb.s_blocks_per_group seems to be set to 65528, which is not a multiple of 4096(fs->u32perblock), so this problem occurs. > Index: src/ext2.c > =================================================================== > RCS file: /cvsroot/ext2resize/ext2resize/src/ext2.c,v > retrieving revision 1.35 > diff -u -3 -p -r1.35 ext2.c > --- src/ext2.c 11 Jun 2006 08:30:07 -0000 1.35 > +++ src/ext2.c 21 Jun 2006 13:42:23 -0000 > @@ -382,7 +382,7 @@ int ext2_block_iterate(struct ext2_fs *f > ext2_brelse(bh, 0); > return 1; > } > - if(((block - gdb_offset)%fs->u32perblock) != i) > + if(((block - gdb_offset)%fs->sb.s_blocks_per_group) != i) > continue; > > bh2 = ext2_bread(fs, udata[i]); > > Friendly, > -- > Petter Reinholdtsen Cheers, sho |