All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dilger, Andreas" <andreas.dilger@intel.com>
To: "linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Bad flexbg_overhead calculation
Date: Wed, 30 Jul 2014 01:07:10 +0000	[thread overview]
Message-ID: <CFFDA174.B4921%andreas.dilger@intel.com> (raw)

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



             reply	other threads:[~2014-07-30  1:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-30  1:07 Dilger, Andreas [this message]
2014-07-30  7:07 ` Bad flexbg_overhead calculation Dilger, Andreas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CFFDA174.B4921%andreas.dilger@intel.com \
    --to=andreas.dilger@intel.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.