linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bad flexbg_overhead calculation
@ 2014-07-30  1:07 Dilger, Andreas
  2014-07-30  7:07 ` Dilger, Andreas
  0 siblings, 1 reply; 2+ messages in thread
From: Dilger, Andreas @ 2014-07-30  1:07 UTC (permalink / raw)
  To: linux-ext4@vger.kernel.org

I was running the "f_random_corruption" test during a build (patches
posted long ago), which formats filesystems with semi-random parameters,
and then
corrupts it and sees if e2fsck can fix it.  In this case, it failed during
mke2fs, but without any obvious reason:

./misc/mke2fs -j -t ext4 -b 4096 -I 1024 -O
sparse_super,filetype,dir_index,resize_inode -F /tmp/tt 79106
mke2fs 1.42.11 (09-Jul-2014)
Creating regular file /tmp/tt
/tmp/tt: Invalid argument passed to ext2 library while setting up
superblock



It looks like this is caused by the following check in ext2fs_initialize():

        flexbg_overhead = super->s_first_data_block + 1 +
		fs->desc_blocks + super->s_reserved_gdt_blocks +
		(__u64)flexbg_size * (2 + fs->inode_blocks_per_group);

	/*
	 * Disallow creating ext4 which breaks flex_bg metadata layout
	 * obviously.
	 */
	if (flexbg_overhead > ext2fs_blocks_count(fs->super)) {
		retval = EXT2_ET_INVALID_ARGUMENT;
		goto cleanup;
	}

I suspect the reason it is failing is due to "-I 1024", which is creating
large inodes with extra xattr space, and this is confusing the flexbg
check, though I don't think this should be considered an invalid option?


Cheers, Andreas
-- 
Andreas Dilger

Lustre Software Architect
Intel High Performance Data Division



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bad flexbg_overhead calculation
  2014-07-30  1:07 Bad flexbg_overhead calculation Dilger, Andreas
@ 2014-07-30  7:07 ` Dilger, Andreas
  0 siblings, 0 replies; 2+ messages in thread
From: Dilger, Andreas @ 2014-07-30  7:07 UTC (permalink / raw)
  To: linux-ext4@vger.kernel.org; +Cc: Akira Fujita

On 2014/07/29, 7:07 PM, "Dilger, Andreas" <andreas.dilger@intel.com> wrote:

>I was running the "f_random_corruption" test during a build (patches
>posted long ago), which formats filesystems with semi-random parameters,
>and then
>corrupts it and sees if e2fsck can fix it.  In this case, it failed during
>mke2fs, but without any obvious reason:
>
>./misc/mke2fs -j -t ext4 -b 4096 -I 1024 -O
>sparse_super,filetype,dir_index,resize_inode -F /tmp/tt 79106
>mke2fs 1.42.11 (09-Jul-2014)
>Creating regular file /tmp/tt
>/tmp/tt: Invalid argument passed to ext2 library while setting up
>superblock
>
>
>
>It looks like this is caused by the following check in
>ext2fs_initialize():
>
>        flexbg_overhead = super->s_first_data_block + 1 +
>		fs->desc_blocks + super->s_reserved_gdt_blocks +
>		(__u64)flexbg_size * (2 + fs->inode_blocks_per_group);
>
>	/*
>	 * Disallow creating ext4 which breaks flex_bg metadata layout
>	 * obviously.
>	 */
>	if (flexbg_overhead > ext2fs_blocks_count(fs->super)) {
>		retval = EXT2_ET_INVALID_ARGUMENT;
>		goto cleanup;
>	}
>
>I suspect the reason it is failing is due to "-I 1024", which is creating
>large inodes with extra xattr space, and this is confusing the flexbg
>check, though I don't think this should be considered an invalid option?

It seems this check/problem was introduced in commit d988201ef9cb6f7b521e5
"mke2fs: prevent creation of unmountable ext4 with large flex_bg count".
It looks like numerous combinations of -I with a larger inode size or
-N with more inodes than blocks can trigger this problem.

It looks like this was introduced just before 1.42.11, but I'd consider it
a blocker to get fixed before 1.42.12 is released.  Now let's see if I can
make a patch for it before I fly in the morning...

Cheers, Andreas
-- 
Andreas Dilger

Lustre Software Architect
Intel High Performance Data Division



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-30  7:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30  1:07 Bad flexbg_overhead calculation Dilger, Andreas
2014-07-30  7:07 ` Dilger, Andreas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).