summaryrefslogtreecommitdiff
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-03-30 11:25:31 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-04-15 08:49:47 -0700
commit4a6de50d5408cdc699588119e2338e580adc2b73 (patch)
tree1c5647c9e3d6fd09b4b15282aa3d926f0d030297 /fs/f2fs/node.c
parent675f10bde6cc3874632a8f684df2a8a2a8ace76e (diff)
f2fs: use PGP_LOCK to check its truncation
Previously, after trylock_page is succeeded, it doesn't check its mapping. In order to fix that, we can just give PGP_LOCK to pagecache_get_page. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 1a33de9d84b1..ade221c9756b 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1202,13 +1202,10 @@ static void flush_inline_data(struct f2fs_sb_info *sbi, nid_t ino)
if (!inode)
return;
- page = pagecache_get_page(inode->i_mapping, 0, FGP_NOWAIT, 0);
+ page = pagecache_get_page(inode->i_mapping, 0, FGP_LOCK|FGP_NOWAIT, 0);
if (!page)
goto iput_out;
- if (!trylock_page(page))
- goto release_out;
-
if (!PageUptodate(page))
goto page_out;
@@ -1223,9 +1220,7 @@ static void flush_inline_data(struct f2fs_sb_info *sbi, nid_t ino)
else
set_page_dirty(page);
page_out:
- unlock_page(page);
-release_out:
- f2fs_put_page(page, 0);
+ f2fs_put_page(page, 1);
iput_out:
iput(inode);
}