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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <502D48B9.4000907@redhat.com>
Date:	Thu, 16 Aug 2012 14:23:37 -0500
From:	Eric Sandeen <esandeen@...hat.com>
To:	"Theodore Ts'o" <tytso@....edu>
CC:	Calvin Walton <calvin.walton@...stin.ca>,
	Andreas Dilger <adilger@...ger.ca>,
	Javier Marcet <jmarcet@...il.com>,
	Linux Ext4 Mailing List <linux-ext4@...r.kernel.org>,
	jpiszcz@...idpixels.com
Subject: Re: Far too long mount time

On 8/16/12 1:53 PM, Theodore Ts'o wrote:
> On Thu, Aug 16, 2012 at 10:42:19AM -0400, Theodore Ts'o wrote:
>> On Thu, Aug 16, 2012 at 10:16:48AM -0400, Calvin Walton wrote:
>>> On Thu, 2012-08-16 at 03:09 -0600, Andreas Dilger wrote:
>>> Is there any fix for this issue queued up for an upcoming stable
>>> release? It still reverts cleanly on 3.5.2.
>>
>> There isn't a fix queued up yet, but there will be one soon....
>
> This patch should solve the problem (as an alternative to reverting
> 8aeb00ff85a).
>
> 						- Ted
>
>
>  From dc43c7a8a6c266c31aa4f0408000c4d1b9f3c787 Mon Sep 17 00:00:00 2001
> From: Theodore Ts'o <tytso@....edu>
> Date: Thu, 16 Aug 2012 11:59:04 -0400
> Subject: [PATCH] ext4: fix long mount times on very big file systems
>
> Commit 8aeb00ff85a: "ext4: fix overhead calculation used by
> ext4_statfs()" introduced a O(n**2) calculation which makes very large
> file systems take forever to mount.  Fix this with an optimization for
> non-bigalloc file systems.  (For bigalloc file systems the overhead
> needs to be set in the the superblock.)

And mkfs with bigalloc will do that, right?

Hm.
         /*
          * Get the # of file system overhead blocks from the
          * superblock if present.
          */
         if (es->s_overhead_clusters)
                 sbi->s_overhead = le32_to_cpu(es->s_overhead_clusters);
         else {
                 ret = ext4_calculate_overhead(sb);
                 if (ret)
                         goto failed_mount_wq;
         }

so if we mkfs'd with bigalloc, s_overhead_clusters will be set and we 
won't call ext4_calculate_overhead, right?

But if we didn't mkfs with bigalloc, we won't have the feature, and
ext4_calc_overhead will exit early.

So when does all of the code after the short-circuit ever run?

-Eric

> Signed-off-by: "Theodore Ts'o" <tytso@....edu>
> Cc: stable@...r.kernel.org
> ---
>   fs/ext4/super.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 603023b..055c65b 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3129,6 +3129,10 @@ static int count_overhead(struct super_block *sb, ext4_group_t grp,
>   	ext4_group_t		i, ngroups = ext4_get_groups_count(sb);
>   	int			s, j, count = 0;
>
> +	if (!EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_BIGALLOC))
> +		return (ext4_bg_has_super(sb, grp) + ext4_bg_num_gdb(sb, i) +
> +			sbi->s_itb_per_group + 2);
> +
>   	first_block = le32_to_cpu(sbi->s_es->s_first_data_block) +
>   		(grp * EXT4_BLOCKS_PER_GROUP(sb));
>   	last_block = first_block + EXT4_BLOCKS_PER_GROUP(sb) - 1;
>

--
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