Re: ext3: bogus i_mode errors with 2.6.18.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Oct 27, 2006  17:34 +0200, Andre Noll wrote:
> On 12:01, Andreas Dilger wrote:
> > Well, since we know at least one bit needs fixing and results in the block
> > being written to disk then setting the bits for all of the other metadata
> > blocks in this group has no extra IO cost (only a tiny amount of CPU).
> > Re-setting the bits if they are already set is not harmful.
> 
> I.e, something like
> 
>         int i;
>         ext3_fsblk_t bit;
>         unsigned long gdblocks = EXT3_SB(sb)->s_gdb_count;
> 
>         for (i = 0, bit = 1; i < gdblocks; i++, bit++)
>                 ext3_set_bit(bit, gdp_bh->b_data);
> 
> Is that correct?

Well, it needs to also handle backup superblock, bitmaps, inode table:

	if (ext3_bg_has_super())
		ext3_set_bit(0, gdp_bh->b_data);
	gdblocks = ext3_bg_num_gdb(sb, group);
	for (i = 0, bit = 1; i < gdblocks; i++, bit++)
		/* actually a bit more complex for INCOMPAT_META_BG fs */
		ext3_set_bit(i, gdp_bh->b_data);
	ext3_set_bit(gdp->bg_inode_bitmap % EXT3_BLOCKS_PER_GROUP(sb), ...);
	ext3_set_bit(gdp->bg_block_bitmap % EXT3_BLOCKS_PER_GROUP(sb), ...);
	for (i = 0, bit = gdp->bg_inode_table % EXT3_BLOCKS_PER_GROUP(sb);
	     i < EXT3_SB(sb)->s_itb_per_group; i++, bit++)
		ext3_set_bit(i, gdp_bh->b_data);
		
(or something close to this).

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux