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: <5919b47f-616a-441d-bfe8-9c03739b61d7@kernel.org>
Date: Mon, 8 Jul 2024 14:09:13 +0800
From: Chao Yu <chao@...nel.org>
To: Sheng Yong <shengyong@...o.com>, jaegeuk@...nel.org
Cc: linux-f2fs-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] f2fs: fix start segno of large section

On 2024/7/6 17:16, Sheng Yong wrote:
> get_ckpt_valid_blocks() checks valid ckpt blocks in current section.
> It counts all vblocks from the first to the last segment in the
> large section. However, START_SEGNO() is used to get the first segno
> in an SIT block. This patch fixes that to get the correct start segno.
> 
> Fixes: 61461fc921b7 ("f2fs: fix to avoid touching checkpointed data in get_victim()")
> Signed-off-by: Sheng Yong <shengyong@...o.com>
> ---
>   fs/f2fs/segment.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
> index e1c0f418aa11..6ed5bc811d2c 100644
> --- a/fs/f2fs/segment.h
> +++ b/fs/f2fs/segment.h
> @@ -347,7 +347,8 @@ static inline unsigned int get_ckpt_valid_blocks(struct f2fs_sb_info *sbi,
>   				unsigned int segno, bool use_section)
>   {
>   	if (use_section && __is_large_section(sbi)) {
> -		unsigned int start_segno = START_SEGNO(segno);
> +		unsigned int start_segno = segno / SEGS_PER_SEC(sbi) *
> +							SEGS_PER_SEC(sbi);

How about using macro?

	unsigned int secno = GET_SEC_FROM_SEG(sbi, segno);
	unsigned int start_seno = GET_SEG_FROM_SEC(sbi, secno);

Thanks,

>   		unsigned int blocks = 0;
>   		int i;
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ