From: Andreas Dilger <adilger@clusterfs.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] fix up lazy_bg bitmap initialization at mkfs time
Date: Fri, 20 Apr 2007 16:19:18 -0600 [thread overview]
Message-ID: <20070420221918.GT5967@schatzie.adilger.int> (raw)
In-Reply-To: <4628D4CF.1020804@redhat.com>
On Apr 20, 2007 09:57 -0500, Eric Sandeen wrote:
> Anyway, how about something like this for calculating journal size in
> the face of lazy_bg. I know the last group may be smaller... but I figure
> this is just a heuristic anyway.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>
> Index: e2fsprogs-1.39_ext4_hg/misc/util.c
> ===================================================================
> --- e2fsprogs-1.39_ext4_hg.orig/misc/util.c
> +++ e2fsprogs-1.39_ext4_hg/misc/util.c
> @@ -252,8 +252,16 @@ void parse_journal_opts(const char *opts
> int figure_journal_size(int size, ext2_filsys fs)
> {
> blk_t j_blocks;
> + blk_t fs_size;
>
> - if (fs->super->s_blocks_count < 2048) {
> + if (EXT2_HAS_COMPAT_FEATURE(fs->super,
> + EXT2_FEATURE_COMPAT_LAZY_BG)) {
> + fs_size = fs->super->s_blocks_per_group * 2;
> + } else {
> + fs_size = fs->super->s_blocks_count;
> + }
This should also check for !RO_COMPAT_UNINIT_GROUPS, since LAZY_BG
can be used in conjunction with UNINIT_GROUPS to mean "don't zero
uninitialized groups" but doesn't set bg_free_blocks_count == 0.
I was going to suggest using s_free_blocks_count, but that might
lead to confusion if e.g. e2fsck deletes a journal on a nearly-full
fs and then tune2fs recreates it much smaller than before.
Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.
prev parent reply other threads:[~2007-04-20 22:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-19 21:07 [PATCH] fix up lazy_bg bitmap initialization at mkfs time Eric Sandeen
2007-04-20 10:10 ` Andreas Dilger
2007-04-20 14:57 ` Eric Sandeen
2007-04-20 22:19 ` Andreas Dilger [this message]
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=20070420221918.GT5967@schatzie.adilger.int \
--to=adilger@clusterfs.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
/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