f2fs: fix to check dirty pages during compressed inode conversion
authorChao Yu <yuchao0@huawei.com>
Tue, 10 Mar 2020 12:50:08 +0000 (20:50 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 11 Mar 2020 15:25:38 +0000 (08:25 -0700)
Compressed cluster can be generated during dirty data writeback,
if there is dirty pages on compressed inode, it needs to disable
converting compressed inode to non-compressed one.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h

index 23013d3b59bae2c7b23dc8b70a6de56e24b53ec9..dbca4c6a7aaf0125b7b7308f946e60ed00f5ad6e 100644 (file)
@@ -3820,6 +3820,8 @@ static inline u64 f2fs_disable_compressed_file(struct inode *inode)
 
        if (!f2fs_compressed_file(inode))
                return 0;
+       if (get_dirty_pages(inode))
+               return 1;
        if (fi->i_compr_blocks)
                return fi->i_compr_blocks;