mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] f2fs: use PGP_LOCK to check its truncation
@ 2016-03-30 20:24 Jaegeuk Kim
  2016-03-30 20:24 ` [PATCH 2/2] f2fs: add BUG_ON to avoid unnecessary flow Jaegeuk Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Jaegeuk Kim @ 2016-03-30 20:24 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim

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>
---
 fs/f2fs/node.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 118321b..2f2810e 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;
 
-- 
2.6.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-30 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-30 20:24 [PATCH 1/2] f2fs: use PGP_LOCK to check its truncation Jaegeuk Kim
2016-03-30 20:24 ` [PATCH 2/2] f2fs: add BUG_ON to avoid unnecessary flow Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®