Skip to content

Commit dc35d73

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: compress: don't compress any datas after cp stop
While compressed data writeback, we need to drop dirty pages like we did for non-compressed pages if cp stops, however it's not needed to compress any data in such case, so let's detect cp stop condition in cluster_may_compress() to avoid redundant compressing and let following f2fs_write_raw_pages() drops dirty pages correctly. Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 47d0d7d commit dc35d73

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/f2fs/compress.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,8 @@ static bool cluster_may_compress(struct compress_ctx *cc)
849849
return false;
850850
if (!f2fs_cluster_is_full(cc))
851851
return false;
852+
if (unlikely(f2fs_cp_error(F2FS_I_SB(cc->inode))))
853+
return false;
852854
return __cluster_may_compress(cc);
853855
}
854856

0 commit comments

Comments
 (0)