f2fs: check truncation of mapping after lock_page

We call lock_page when we need to update a page after readpage.
Between grab and lock page, the page can be truncated by other thread.
So, we should check the page after lock_page whether it was truncated or not.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
This commit is contained in:
Jaegeuk Kim
2013-04-26 11:55:17 +09:00
parent 55008d845d
commit afcb7ca01f
4 changed files with 39 additions and 7 deletions

View File

@@ -65,6 +65,10 @@ repeat:
goto repeat;
lock_page(page);
if (page->mapping != mapping) {
f2fs_put_page(page, 1);
goto repeat;
}
out:
mark_page_accessed(page);
return page;