Re: [ext2resize] Patches for ext2resize?
Status: Inactive
Brought to you by:
adilger
From: <sh...@tn...> - 2006-06-20 08:46:29
|
Hi, >> Hi, >> >> I had gone out for three days so the reply to you was delayed. >> >>> Can you explain why the rest of the patch is needed? This is the >>> patch updated to the current CVS version. >> >> OK, I described comments below. I found a bug in my patch which you applied to CVS. ext2_block_iterate(): ------------------------------------------------------------------------ /* Double indirect blocks for next 2^16/2^18/2^20 1k/2k/4k blocks */ for (i = 0; i < fs->u32perblock; i++) { : : if (!udata[i]) continue; if(udata[i] == block){ ext2_brelse(bh, 0); return 1; } *** if(((block - gdb_offset)%fs->u32perblock) != i) continue; ------------------------------------------------------------------------ The "block" should be stored to the double indirect block whose block number should be got from the offset(block - gdb_offset)%fs->s_blocks_per_group) in the single indirect block. However, actually the target double indirect block number is got from the offset(block - gdb_offset)%fs->u32perblock) as the above code marked with "***". So ext2_block_iterate() cannot find the target double indirect block number and returns -1(error). We should fix the above code as below. ------------------------------------------------------------------------- - if(((block - gdb_offset)%fs->u32perblock) != i) + if(((block - gdb_offset)%fs->sb.s_blocks_per_group) != i) ------------------------------------------------------------------------- Cheers, sho |