Skip to content

Commit

Permalink
f2fs: check node page contents all the time
Browse files Browse the repository at this point in the history
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: Jaegeuk Kim <jaegeuk@kernel.org>
  • Loading branch information
Jaegeuk Kim committed Feb 12, 2015
1 parent 2e02317 commit aaf9607
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/f2fs/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,19 +1036,18 @@ struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
err = read_node_page(page, READ_SYNC);
if (err < 0)
return ERR_PTR(err);
else if (err == LOCKED_PAGE)
goto got_it;
else if (err != LOCKED_PAGE)
lock_page(page);

lock_page(page);
if (unlikely(!PageUptodate(page) || nid != nid_of_node(page))) {
ClearPageUptodate(page);
f2fs_put_page(page, 1);
return ERR_PTR(-EIO);
}
if (unlikely(page->mapping != NODE_MAPPING(sbi))) {
f2fs_put_page(page, 1);
goto repeat;
}
got_it:
return page;
}

Expand Down

0 comments on commit aaf9607

Please sign in to comment.