From afcb7ca01f47b0481e0b248d1542d0934fa70767 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Fri, 26 Apr 2013 11:55:17 +0900 Subject: 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 --- fs/f2fs/checkpoint.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/f2fs/checkpoint.c') diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 590ea50c80a7..b1de01da1a40 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -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; -- cgit v1.2.3