mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
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>
This commit is contained in:
parent
0e022ea8fc
commit
7612118ae8
1 changed files with 5 additions and 6 deletions
|
@ -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 @@ struct page *get_new_data_page(struct inode *inode,
|
|||
} 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) <
|
||||
|
|
Loading…
Reference in a new issue