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: <20220929112454.ribbghdrz3qvyy2b@quack3>
Date:   Thu, 29 Sep 2022 13:24:54 +0200
From:   Jan Kara <jack@...e.cz>
To:     Ojaswin Mujoo <ojaswin@...ux.ibm.com>
Cc:     linux-ext4@...r.kernel.org, Theodore Ts'o <tytso@....edu>,
        Ritesh Harjani <riteshh@...ux.ibm.com>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        Andreas Dilger <adilger.kernel@...ger.ca>,
        Jan Kara <jack@...e.cz>, rookxu <brookxu.cn@...il.com>,
        Ritesh Harjani <ritesh.list@...il.com>
Subject: Re: [RFC v3 1/8] ext4: Stop searching if PA doesn't satisfy
 non-extent file

On Tue 27-09-22 14:46:41, Ojaswin Mujoo wrote:
> If we come across a PA that matches the logical offset but is unable to
> satisfy a non-extent file due to its physical start being higher than
> that supported by non extent files, then simply stop searching for
> another PA and break out of loop. This is because, since PAs don't
> overlap, we won't be able to find another inode PA which can satisfy the
> original request.
> 
> Signed-off-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@...il.com>

Looks good. Feel free to add:

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

								Honza

> ---
>  fs/ext4/mballoc.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 71f5b67d7f28..2e3eb632a216 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -4383,8 +4383,13 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac)
>  		/* non-extent files can't have physical blocks past 2^32 */
>  		if (!(ext4_test_inode_flag(ac->ac_inode, EXT4_INODE_EXTENTS)) &&
>  		    (pa->pa_pstart + EXT4_C2B(sbi, pa->pa_len) >
> -		     EXT4_MAX_BLOCK_FILE_PHYS))
> -			continue;
> +		     EXT4_MAX_BLOCK_FILE_PHYS)) {
> +			/*
> +			 * Since PAs don't overlap, we won't find any
> +			 * other PA to satisfy this.
> +			 */
> +			break;
> +		}
>  
>  		/* found preallocated blocks, use them */
>  		spin_lock(&pa->pa_lock);
> -- 
> 2.31.1
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ