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: <04bbaf3a-e1ec-a5ae-a664-68d1299aaeb6@kernel.org>
Date:   Fri, 28 Sep 2018 19:58:46 +0800
From:   Chao Yu <chao@...nel.org>
To:     Jaegeuk Kim <jaegeuk@...nel.org>, linux-kernel@...r.kernel.org,
        linux-f2fs-devel@...ts.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: clear PageError on the read path

On 2018-9-26 9:46, Jaegeuk Kim wrote:
> When running fault injection test, I hit somewhat wrong behavior in f2fs_gc ->
> gc_data_segment():
> 
> 0. fault injection generated some PageError'ed pages
> 
> 1. gc_data_segment
>  -> f2fs_get_read_data_page(REQ_RAHEAD)
> 
> 2. move_data_page
>  -> f2fs_get_lock_data_page()
>   -> f2f_get_read_data_page()
>    -> f2fs_submit_page_read()
>     -> submit_bio(READ)
>   -> return EIO due to PageError
>   -> fail to move data
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@...nel.org>
> ---
>  fs/f2fs/data.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 41102c227eee..cb3ebcae0398 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -77,7 +77,8 @@ static void __read_end_io(struct bio *bio)
>  		/* PG_error was set if any post_read step failed */
>  		if (bio->bi_status || PageError(page)) {
>  			ClearPageUptodate(page);
> -			SetPageError(page);
> +			/* will re-read again later */
> +			ClearPageError(page);
>  		} else {
>  			SetPageUptodate(page);

How about:

if (PaegeError(page))
	ClearPageError(page);

if (bio->bi_status) {
	ClearPageUptodate(page);
	SetPageError(page);
} else {
	SetPageUptodate(page);
	ClearPageError(page);
}

So that below codes are not needed.

Thanks,

>  		}
> @@ -591,6 +592,7 @@ static int f2fs_submit_page_read(struct inode *inode, struct page *page,
>  		bio_put(bio);
>  		return -EFAULT;
>  	}
> +	ClearPageError(page);
>  	__submit_bio(F2FS_I_SB(inode), bio, DATA);
>  	return 0;
>  }
> @@ -1571,6 +1573,7 @@ static int f2fs_mpage_readpages(struct address_space *mapping,
>  		if (bio_add_page(bio, page, blocksize, 0) < blocksize)
>  			goto submit_and_realloc;
>  
> +		ClearPageError(page);
>  		last_block_in_bio = block_nr;
>  		goto next_page;
>  set_error_page:
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ