[PATCH] f2fs: check the page status filled from disk

From: Jaegeuk Kim
Date: Sat Jan 02 2016 - 01:03:47 EST


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

Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
---
fs/f2fs/data.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 89a978c..89d633a 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -442,12 +442,16 @@ repeat:
} else {
f2fs_put_page(page, 1);

- page = get_read_data_page(inode, index, READ_SYNC, true);
- if (IS_ERR(page))
- goto repeat;
+ f2fs_bug_on(F2FS_I_SB(inode), ipage);

- /* wait for read completion */
- lock_page(page);
+ page = get_lock_data_page(inode, index, true);
+ if (IS_ERR(page)) {
+ if (PTR_ERR(page) == -EIO) {
+ f2fs_put_page(ipage, 1);
+ return page;
+ }
+ goto repeat;
+ }
}
got_it:
if (new_i_size && i_size_read(inode) <
--
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/