All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: check node page again in write end io
@ 2018-01-10  8:37 Yunlei He
  2018-01-10 15:16 ` Chao Yu
  2018-01-11  5:20 ` Jaegeuk Kim
  0 siblings, 2 replies; 3+ messages in thread
From: Yunlei He @ 2018-01-10  8:37 UTC (permalink / raw)
  To: jaegeuk, yuchao0, linux-f2fs-devel; +Cc: ning.jia, heyunlei

Check node page again in write end io in case of
data corruption during inflght IO.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
---
 fs/f2fs/data.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 72d5d36..d9246a8 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -114,6 +114,11 @@ static void f2fs_write_end_io(struct bio *bio)
 			if (type == F2FS_WB_CP_DATA)
 				f2fs_stop_checkpoint(sbi, true);
 		}
+
+		if (page->mapping == NODE_MAPPING(sbi) &&
+					page->index != nid_of_node(page))
+			f2fs_bug_on(sbi, 1);
+
 		dec_page_count(sbi, type);
 		clear_cold_data(page);
 		end_page_writeback(page);
-- 
1.9.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] f2fs: check node page again in write end io
  2018-01-10  8:37 [PATCH] f2fs: check node page again in write end io Yunlei He
@ 2018-01-10 15:16 ` Chao Yu
  2018-01-11  5:20 ` Jaegeuk Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2018-01-10 15:16 UTC (permalink / raw)
  To: Yunlei He, jaegeuk, yuchao0, linux-f2fs-devel; +Cc: ning.jia

On 2018/1/10 16:37, Yunlei He wrote:
> Check node page again in write end io in case of
> data corruption during inflght IO.
> 
> Signed-off-by: Yunlei He <heyunlei@huawei.com>

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

Thanks,

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] f2fs: check node page again in write end io
  2018-01-10  8:37 [PATCH] f2fs: check node page again in write end io Yunlei He
  2018-01-10 15:16 ` Chao Yu
@ 2018-01-11  5:20 ` Jaegeuk Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2018-01-11  5:20 UTC (permalink / raw)
  To: Yunlei He; +Cc: ning.jia, linux-f2fs-devel

On 01/10, Yunlei He wrote:
> Check node page again in write end io in case of
> data corruption during inflght IO.
> 
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
> ---
>  fs/f2fs/data.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 72d5d36..d9246a8 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -114,6 +114,11 @@ static void f2fs_write_end_io(struct bio *bio)
>  			if (type == F2FS_WB_CP_DATA)
>  				f2fs_stop_checkpoint(sbi, true);
>  		}
> +
> +		if (page->mapping == NODE_MAPPING(sbi) &&
> +					page->index != nid_of_node(page))
> +			f2fs_bug_on(sbi, 1);

Could you please write:
		f2fs_bug_on(sbi, page->mapping == NODE_MAPPING(sbi) &&
					page->index != nid_of_node(page));

Thanks,

> +
>  		dec_page_count(sbi, type);
>  		clear_cold_data(page);
>  		end_page_writeback(page);
> -- 
> 1.9.1

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-11  5:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10  8:37 [PATCH] f2fs: check node page again in write end io Yunlei He
2018-01-10 15:16 ` Chao Yu
2018-01-11  5:20 ` Jaegeuk Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.