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: <eywbqqzeiiz63dqsxrvetpqyj3poniywbvm4wwpcacmr6skaqb@ircbveu4srgi>
Date: Mon, 3 Nov 2025 09:19:02 +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 06/25] ext4: introduce s_min_folio_order for future BS >
 PS support

On Sat 25-10-25 11:22:02, libaokun@...weicloud.com wrote:
> From: Baokun Li <libaokun1@...wei.com>
> 
> This commit introduces the s_min_folio_order field to the ext4_sb_info
> structure. This field will store the minimum folio order required by the
> current filesystem, laying groundwork for future support of block sizes
> greater than PAGE_SIZE.
> 
> Signed-off-by: Baokun Li <libaokun1@...wei.com>
> Reviewed-by: Zhang Yi <yi.zhang@...wei.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.cz>

								Honza

> ---
>  fs/ext4/ext4.h  |  3 +++
>  fs/ext4/inode.c |  3 ++-
>  fs/ext4/super.c | 10 +++++-----
>  3 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index 93c2bf4d125a..bca6c3709673 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -1677,6 +1677,9 @@ struct ext4_sb_info {
>  	/* record the last minlen when FITRIM is called. */
>  	unsigned long s_last_trim_minblks;
>  
> +	/* minimum folio order of a page cache allocation */
> +	unsigned int s_min_folio_order;
> +
>  	/* Precomputed FS UUID checksum for seeding other checksums */
>  	__u32 s_csum_seed;
>  
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index a63513a3db53..889761ed51dd 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -5174,7 +5174,8 @@ void ext4_set_inode_mapping_order(struct inode *inode)
>  	if (!ext4_should_enable_large_folio(inode))
>  		return;
>  
> -	mapping_set_folio_order_range(inode->i_mapping, 0,
> +	mapping_set_folio_order_range(inode->i_mapping,
> +				      EXT4_SB(inode->i_sb)->s_min_folio_order,
>  				      EXT4_MAX_PAGECACHE_ORDER(inode));
>  }
>  
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index aa5aee4d1b63..d353e25a5b92 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -5100,11 +5100,8 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
>  	 * If the default block size is not the same as the real block size,
>  	 * we need to reload it.
>  	 */
> -	if (sb->s_blocksize == blocksize) {
> -		*lsb = logical_sb_block;
> -		sbi->s_sbh = bh;
> -		return 0;
> -	}
> +	if (sb->s_blocksize == blocksize)
> +		goto success;
>  
>  	/*
>  	 * bh must be released before kill_bdev(), otherwise
> @@ -5135,6 +5132,9 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
>  		ext4_msg(sb, KERN_ERR, "Magic mismatch, very weird!");
>  		goto out;
>  	}
> +
> +success:
> +	sbi->s_min_folio_order = get_order(blocksize);
>  	*lsb = logical_sb_block;
>  	sbi->s_sbh = bh;
>  	return 0;
> -- 
> 2.46.1
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ