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] [day] [month] [year] [list]
Message-ID: <00a9826a-f6a7-cba5-ba3f-e740b060e03c@huawei.com>
Date:   Fri, 24 Feb 2017 09:33:16 +0800
From:   Chao Yu <yuchao0@...wei.com>
To:     Yunlong Song <yunlong.song@...wei.com>, <jaegeuk@...nel.org>,
        <cm224.lee@...sung.com>, <chao@...nel.org>, <sylinux@....com>,
        <miaoxie@...wei.com>
CC:     <bintian.wang@...wei.com>, <linux-fsdevel@...r.kernel.org>,
        <linux-f2fs-devel@...ts.sourceforge.net>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] f2fs: put allocate_segment after refresh_sit_entry

On 2017/2/21 16:59, Yunlong Song wrote:
> SIT information should be updated before segment allocation, since SSR needs
> latest valid block information. Current code does not update the old_blkaddr
> info in sit_entry, so adjust the allocate_segment to its proper location. Commit
> 5e443818fa0b2a2845561ee25bec181424fb2889 ("f2fs: handle dirty segments inside
> refresh_sit_entry") puts it into wrong location.

Not a big deal, because we only count invalid block which has been checkpointed,
so current order won't change the result of allocation with SSR.

Anyway, it's OK to me. :)

Reviewed-by: Chao Yu <yuchao0@...wei.com>

> 
> Signed-off-by: Yunlong Song <yunlong.song@...wei.com>
> ---
>  fs/f2fs/segment.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index df2ff5c..89052df 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1743,14 +1743,15 @@ void allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
>  
>  	stat_inc_block_count(sbi, curseg);
>  
> -	if (!__has_curseg_space(sbi, type))
> -		sit_i->s_ops->allocate_segment(sbi, type, false);
>  	/*
>  	 * SIT information should be updated before segment allocation,
>  	 * since SSR needs latest valid block information.
>  	 */
>  	refresh_sit_entry(sbi, old_blkaddr, *new_blkaddr);
>  
> +	if (!__has_curseg_space(sbi, type))
> +		sit_i->s_ops->allocate_segment(sbi, type, false);
> +
>  	mutex_unlock(&sit_i->sentry_lock);
>  
>  	if (page && IS_NODESEG(type))
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ