Commit aaf96075 authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: check node page contents all the time

In get_node_page, if the page is up-to-date, we assumed that the page was not
reclaimed at all.
But, sometimes it was reported that its contents was missing.
So, just for sure, let's check its mapping and contents.
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 2e023174
...@@ -1036,11 +1036,11 @@ struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid) ...@@ -1036,11 +1036,11 @@ struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
err = read_node_page(page, READ_SYNC); err = read_node_page(page, READ_SYNC);
if (err < 0) if (err < 0)
return ERR_PTR(err); return ERR_PTR(err);
else if (err == LOCKED_PAGE) else if (err != LOCKED_PAGE)
goto got_it; lock_page(page);
lock_page(page);
if (unlikely(!PageUptodate(page) || nid != nid_of_node(page))) { if (unlikely(!PageUptodate(page) || nid != nid_of_node(page))) {
ClearPageUptodate(page);
f2fs_put_page(page, 1); f2fs_put_page(page, 1);
return ERR_PTR(-EIO); return ERR_PTR(-EIO);
} }
...@@ -1048,7 +1048,6 @@ struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid) ...@@ -1048,7 +1048,6 @@ struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
f2fs_put_page(page, 1); f2fs_put_page(page, 1);
goto repeat; goto repeat;
} }
got_it:
return page; return page;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment