linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: tytso@mit.edu, darrick.wong@oracle.com
Cc: linux-ext4@vger.kernel.org
Subject: [PATCH 02/12] libext2fs: automatically enable meta_bg to avoid filling up BG 0
Date: Mon, 12 Oct 2015 14:56:42 -0700	[thread overview]
Message-ID: <20151012215642.29065.18353.stgit@birch.djwong.org> (raw)
In-Reply-To: <20151012215629.29065.24418.stgit@birch.djwong.org>

If during formatting we'd lose more than half of a block group to
group descriptors and other metadata, enable the meta_bg feature.
This enables us to create >500T filesystems with default options.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 lib/ext2fs/initialize.c |    5 +++++
 1 file changed, 5 insertions(+)


diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index f672a27..b5ca928 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -381,6 +381,11 @@ ipg_retry:
 	overhead = (int) (3 + fs->inode_blocks_per_group +
 			  super->s_reserved_gdt_blocks);
 
+	/* Enable meta_bg if we'd lose more than 3/4 of a BG to GDT blocks. */
+	if (super->s_reserved_gdt_blocks + fs->desc_blocks >
+	    super->s_blocks_per_group * 3 / 4)
+		fs->super->s_feature_incompat |= EXT2_FEATURE_INCOMPAT_META_BG;
+
 	if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
 		overhead++;
 	else


  parent reply	other threads:[~2015-10-12 21:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 21:56 [PATCH 00/12] e2fsprogs: misc fixes and cleanups; save checksum seeds Darrick J. Wong
2015-10-12 21:56 ` [PATCH 01/12] libext2fs: fix maximum bg overhead calculation with meta_bg enabled Darrick J. Wong
2015-10-24  4:37   ` Theodore Ts'o
2015-10-12 21:56 ` Darrick J. Wong [this message]
2015-10-13  2:34   ` [PATCH 02/12] libext2fs: automatically enable meta_bg to avoid filling up BG 0 Andreas Dilger
2015-10-13  7:08     ` Darrick J. Wong
2015-10-24  4:38   ` Theodore Ts'o
2015-10-12 21:56 ` [PATCH 03/12] libext2fs: clean up feature test macros with predicate functions Darrick J. Wong
2015-10-24  4:41   ` Theodore Ts'o
2015-10-12 21:56 ` [PATCH 04/12] e2fsck: " Darrick J. Wong
2015-10-24  4:49   ` Theodore Ts'o
2015-10-12 21:57 ` [PATCH 05/12] misc: " Darrick J. Wong
2015-10-24  5:24   ` Theodore Ts'o
2015-10-12 21:57 ` [PATCH 06/12] resize2fs: " Darrick J. Wong
2015-10-24  5:24   ` Theodore Ts'o
2015-10-12 21:57 ` [PATCH 07/12] debugfs: " Darrick J. Wong
2015-10-24  5:26   ` Theodore Ts'o
2015-10-12 21:57 ` [PATCH 08/12] libext2fs: store checksum seed in superblock Darrick J. Wong
2015-10-12 21:57 ` [PATCH 09/12] tune2fs: allow user to turn on saving the checksum seed Darrick J. Wong
2015-10-12 21:57 ` [PATCH 10/12] e2fsck: check the checksum seed feature flag is set correctly Darrick J. Wong
2015-10-12 21:57 ` [PATCH 11/12] mke2fs: store checksum seed at format time Darrick J. Wong
2015-10-12 21:57 ` [PATCH 12/12] tests: check proper operation of metadata_csum_seed Darrick J. Wong

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=20151012215642.29065.18353.stgit@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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 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).