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] [thread-next>] [day] [month] [year] [list]
Message-ID: <qmsx753xemvacoaghwhv6emusazmlynv54qqxwsdfsoaoeqre4@bp2lgrdufaim>
Date: Mon, 3 Nov 2025 09:14:09 +0100
From: Jan Kara <jack@...e.cz>
To: libaokun@...weicloud.com
Cc: linux-ext4@...r.kernel.org, tytso@....edu, adilger.kernel@...ger.ca, 
	jack@...e.cz, linux-kernel@...r.kernel.org, kernel@...kajraghav.com, 
	mcgrof@...nel.org, linux-fsdevel@...r.kernel.org, linux-mm@...ck.org, 
	yi.zhang@...wei.com, yangerkun@...wei.com, chengzhihao1@...wei.com, 
	libaokun1@...wei.com
Subject: Re: [PATCH 07/25] ext4: support large block size in
 ext4_calculate_overhead()

On Sat 25-10-25 11:22:03, libaokun@...weicloud.com wrote:
> From: Baokun Li <libaokun1@...wei.com>
> 
> ext4_calculate_overhead() used a single page for its bitmap buffer, which
> worked fine when PAGE_SIZE >= block size. However, with block size greater
> than page size (BS > PS) support, the bitmap can exceed a single page.
> 
> To address this, we now use __get_free_pages() to allocate multiple pages,
> sized to the block size, to properly support BS > PS.
> 
> Signed-off-by: Baokun Li <libaokun1@...wei.com>
> Reviewed-by: Zhang Yi <yi.zhang@...wei.com>

One comment below:

> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index d353e25a5b92..7338c708ea1d 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -4182,7 +4182,8 @@ int ext4_calculate_overhead(struct super_block *sb)
>  	unsigned int j_blocks, j_inum = le32_to_cpu(es->s_journal_inum);
>  	ext4_group_t i, ngroups = ext4_get_groups_count(sb);
>  	ext4_fsblk_t overhead = 0;
> -	char *buf = (char *) get_zeroed_page(GFP_NOFS);
> +	gfp_t gfp = GFP_NOFS | __GFP_ZERO;
> +	char *buf = (char *)__get_free_pages(gfp, sbi->s_min_folio_order);

I think this should be using kvmalloc(). There's no reason to require
physically contiguous pages for this...

								Honza
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ