Re: [Q] ext3 mkfs: zeroing journal blocks

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

 



On May 11, 2009  13:44 -0500, Eric Sandeen wrote:
> Andreas Dilger wrote:
> > The reason that the journal is zeroed is because there is some chance
> > that old (valid at the time) transaction headers and commit blocks might
> > be in the journal and could accidentally be "recovered" and cause bad
> > corruption of the filesystem.
> 
> But I guess the question is, why isn't a normal internal log zeroed?
> 
> If I'm reading it right only external logs get this treatment, and I
> think that's what generated the original question from Alexander.

Hmm, possibly because when ext3 was first allocated the internal journal
created was "dd if=/dev/zero of=/mnt/fs/.journal bs=1M count={jnl_size}"
on the filesystem mounted as ext2, so normal filesystem IO would handle
the zeroing of the blocks.  Even today if tune2fs adds a journal to a
filesystem it does the zero filling of the journal.

Looking at the mke2fs code it also appears to be doing zeroing of the
journal inode in:

      mke2fs
        ->ext2fs_add_journal_inode
	  ->write_journal_inode
	    ->ext2fs_block_iterate
	      ->mkjournal_proc (increment zero_count)
	  ->ext2fs_zero_blocks

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, 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