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: <df6b44f0-ee25-f264-b105-e942586e5b39@huawei.com>
Date:   Mon, 4 Sep 2017 09:33:25 +0800
From:   Chao Yu <yuchao0@...wei.com>
To:     Jaegeuk Kim <jaegeuk@...nel.org>, <linux-kernel@...r.kernel.org>,
        <linux-fsdevel@...r.kernel.org>,
        <linux-f2fs-devel@...ts.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH 2/2] f2fs: don't check inode's checksum if it
 was dirtied or writebacked

On 2017/9/2 1:25, Jaegeuk Kim wrote:
> If another thread already made the page dirtied or writebacked, we must avoid
> to verify checksum. If we got an error, we need to remove its uptodate as well.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@...nel.org>

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

> ---
>  fs/f2fs/inode.c | 3 ++-
>  fs/f2fs/node.c  | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
> index b4c401d456e7..c33b05aec1a1 100644
> --- a/fs/f2fs/inode.c
> +++ b/fs/f2fs/inode.c
> @@ -153,7 +153,8 @@ bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct page *page)
>  	struct f2fs_inode *ri;
>  	__u32 provided, calculated;
>  
> -	if (!f2fs_enable_inode_chksum(sbi, page))
> +	if (!f2fs_enable_inode_chksum(sbi, page) ||
> +			PageDirty(page) || PageWriteback(page))
>  		return true;
>  
>  	ri = &F2FS_NODE(page)->i;
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index 388a00262a5f..fca87835a1da 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -1187,9 +1187,9 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
>  			nid, nid_of_node(page), ino_of_node(page),
>  			ofs_of_node(page), cpver_of_node(page),
>  			next_blkaddr_of_node(page));
> -		ClearPageUptodate(page);
>  		err = -EINVAL;
>  out_err:
> +		ClearPageUptodate(page);
>  		f2fs_put_page(page, 1);
>  		return ERR_PTR(err);
>  	}
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ