f2fs: fix to account compressed inode correctly
authorChao Yu <yuchao0@huawei.com>
Tue, 10 Mar 2020 12:50:07 +0000 (20:50 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 11 Mar 2020 15:25:38 +0000 (08:25 -0700)
stat_inc_compr_inode() needs to check FI_COMPRESSED_FILE flag, so
in f2fs_disable_compressed_file(), we should call stat_dec_compr_inode()
before clearing FI_COMPRESSED_FILE flag.

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

index 760a05f98ac791a26bb5b8c05989ade799e3f042..23013d3b59bae2c7b23dc8b70a6de56e24b53ec9 100644 (file)
@@ -3824,8 +3824,8 @@ static inline u64 f2fs_disable_compressed_file(struct inode *inode)
                return fi->i_compr_blocks;
 
        fi->i_flags &= ~F2FS_COMPR_FL;
-       clear_inode_flag(inode, FI_COMPRESSED_FILE);
        stat_dec_compr_inode(inode);
+       clear_inode_flag(inode, FI_COMPRESSED_FILE);
        return 0;
 }