diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-01-01 22:03:47 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-01-08 11:45:21 -0800 |
commit | 7612118ae8cdd36cbd74d873855d70252d2d49e3 (patch) | |
tree | 392767ab14193434686a7c4d5ef20f164bacb0b6 /fs/f2fs | |
parent | 0e022ea8fc49ed9c72ab9dcd9ca96414dc026184 (diff) |
f2fs: check the page status filled from disk
After reading a page, we need to check whether there is any error.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/data.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index ac5bea0f5f09..77c3bbb9bee0 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -413,7 +413,7 @@ struct page *get_new_data_page(struct inode *inode, struct page *page; struct dnode_of_data dn; int err; -repeat: + page = f2fs_grab_cache_page(mapping, index, true); if (!page) { /* @@ -442,12 +442,11 @@ repeat: } else { f2fs_put_page(page, 1); - page = get_read_data_page(inode, index, READ_SYNC, true); + /* if ipage exists, blkaddr should be NEW_ADDR */ + f2fs_bug_on(F2FS_I_SB(inode), ipage); + page = get_lock_data_page(inode, index, true); if (IS_ERR(page)) - goto repeat; - - /* wait for read completion */ - lock_page(page); + return page; } got_it: if (new_i_size && i_size_read(inode) < |