lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 20 Apr 2007 16:19:18 -0600
From:	Andreas Dilger <adilger@...sterfs.com>
To:	Eric Sandeen <sandeen@...hat.com>
Cc:	ext4 development <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] fix up lazy_bg bitmap initialization at mkfs time

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@...hat.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.

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ