Skip to content

Commit 2a64e30

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: don't drop compressed page cache in .{invalidate,release}page
For compressed inode, in .{invalidate,release}page, we will call f2fs_invalidate_compress_pages() to drop all compressed page cache of current inode. But we don't need to drop compressed page cache synchronously in .invalidatepage, because, all trancation paths of compressed physical block has been covered with f2fs_invalidate_compress_page(). And also we don't need to drop compressed page cache synchronously in .releasepage, because, if there is out-of-memory, we can count on page cache reclaim on sbi->compress_inode. BTW, this patch may fix the issue reported below: https://lore.kernel.org/linux-f2fs-devel/[email protected]/T/#u Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 300a842 commit 2a64e30

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

fs/f2fs/data.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3528,12 +3528,9 @@ void f2fs_invalidate_page(struct page *page, unsigned int offset,
35283528

35293529
clear_page_private_gcing(page);
35303530

3531-
if (test_opt(sbi, COMPRESS_CACHE)) {
3532-
if (f2fs_compressed_file(inode))
3533-
f2fs_invalidate_compress_pages(sbi, inode->i_ino);
3534-
if (inode->i_ino == F2FS_COMPRESS_INO(sbi))
3535-
clear_page_private_data(page);
3536-
}
3531+
if (test_opt(sbi, COMPRESS_CACHE) &&
3532+
inode->i_ino == F2FS_COMPRESS_INO(sbi))
3533+
clear_page_private_data(page);
35373534

35383535
if (page_private_atomic(page))
35393536
return f2fs_drop_inmem_page(inode, page);
@@ -3553,12 +3550,9 @@ int f2fs_release_page(struct page *page, gfp_t wait)
35533550
return 0;
35543551

35553552
if (test_opt(F2FS_P_SB(page), COMPRESS_CACHE)) {
3556-
struct f2fs_sb_info *sbi = F2FS_P_SB(page);
35573553
struct inode *inode = page->mapping->host;
35583554

3559-
if (f2fs_compressed_file(inode))
3560-
f2fs_invalidate_compress_pages(sbi, inode->i_ino);
3561-
if (inode->i_ino == F2FS_COMPRESS_INO(sbi))
3555+
if (inode->i_ino == F2FS_COMPRESS_INO(F2FS_I_SB(inode)))
35623556
clear_page_private_data(page);
35633557
}
35643558

0 commit comments

Comments
 (0)