Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bb5e2c8 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: return -EIO when node id is not matched



During the cleaing of node segments, F2FS can get errored node blocks due to
data race between node page lock and its valid bitmap operations.
In that case, it needs to return an error to skip such the obsolete block copy.

Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 808a1d74
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -958,7 +958,7 @@ struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
		goto got_it;

	lock_page(page);
	if (unlikely(!PageUptodate(page))) {
	if (unlikely(!PageUptodate(page) || nid != nid_of_node(page))) {
		f2fs_put_page(page, 1);
		return ERR_PTR(-EIO);
	}
@@ -967,7 +967,6 @@ struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
		goto repeat;
	}
got_it:
	f2fs_bug_on(nid != nid_of_node(page));
	mark_page_accessed(page);
	return page;
}