linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] f2fs: check the page status filled from disk
@ 2016-01-03  1:26 Jaegeuk Kim
  2016-01-03  1:26 ` [PATCH 2/3] f2fs: cover more area with nat_tree_lock Jaegeuk Kim
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Jaegeuk Kim @ 2016-01-03  1:26 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim

After reading a page, we need to check whether there is any error.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/data.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 89a978c..11b2111 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -448,6 +448,14 @@ repeat:
 
 		/* wait for read completion */
 		lock_page(page);
+		if (unlikely(!PageUptodate(page))) {
+			f2fs_put_page(page, 1);
+			return ERR_PTR(-EIO);
+		}
+		if (unlikely(page->mapping != mapping)) {
+			f2fs_put_page(page, 1);
+			goto repeat;
+		}
 	}
 got_it:
 	if (new_i_size && i_size_read(inode) <
-- 
2.6.3

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

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

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-03  1:26 [PATCH 1/3] f2fs: check the page status filled from disk Jaegeuk Kim
2016-01-03  1:26 ` [PATCH 2/3] f2fs: cover more area with nat_tree_lock Jaegeuk Kim
2016-01-05  9:33   ` [f2fs-dev] " Chao Yu
2016-01-05 17:57     ` Jaegeuk Kim
2016-01-06  3:57       ` Chao Yu
2016-01-03  1:26 ` [PATCH 3/3] Revert "f2fs: check the node block address of newly allocated nid" Jaegeuk Kim
2016-01-05  9:31 ` [PATCH 1/3] f2fs: check the page status filled from disk Chao Yu
2016-01-05 17:48   ` [f2fs-dev] " Jaegeuk Kim
2016-01-06  1:21     ` Chao Yu
2016-01-06  2:30       ` Jaegeuk Kim
2016-01-06  4:10 ` [PATCH 1/3 v2] " Jaegeuk Kim
2016-01-06  5:20   ` [f2fs-dev] " Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).