diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-04-25 22:55:17 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-04-28 22:19:32 -0400 |
commit | afcb7ca01f47b0481e0b248d1542d0934fa70767 (patch) | |
tree | 2834b57b958d2b444d40aa8144ac60ee739507ac /fs/f2fs/checkpoint.c | |
parent | 55008d845d233396ed374473da4613cee691aa03 (diff) |
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>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r-- | fs/f2fs/checkpoint.c | 4 |
1 files changed, 4 insertions, 0 deletions
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: | |||
65 | goto repeat; | 65 | goto repeat; |
66 | 66 | ||
67 | lock_page(page); | 67 | lock_page(page); |
68 | if (page->mapping != mapping) { | ||
69 | f2fs_put_page(page, 1); | ||
70 | goto repeat; | ||
71 | } | ||
68 | out: | 72 | out: |
69 | mark_page_accessed(page); | 73 | mark_page_accessed(page); |
70 | return page; | 74 | return page; |