Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: fix to disable compression on directory

It needs to call f2fs_disable_compressed_file() to disable
compression on directory.

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

authored by

Chao Yu and committed by
Jaegeuk Kim
aa576970 9b6ed143

+7 -5
+6 -4
fs/f2fs/f2fs.h
··· 3849 3849 3850 3850 if (!f2fs_compressed_file(inode)) 3851 3851 return 0; 3852 - if (get_dirty_pages(inode)) 3853 - return 1; 3854 - if (fi->i_compr_blocks) 3855 - return fi->i_compr_blocks; 3852 + if (S_ISREG(inode->i_mode)) { 3853 + if (get_dirty_pages(inode)) 3854 + return 1; 3855 + if (fi->i_compr_blocks) 3856 + return fi->i_compr_blocks; 3857 + } 3856 3858 3857 3859 fi->i_flags &= ~F2FS_COMPR_FL; 3858 3860 stat_dec_compr_inode(inode);
+1 -1
fs/f2fs/file.c
··· 1815 1815 } 1816 1816 1817 1817 if ((iflags ^ masked_flags) & F2FS_COMPR_FL) { 1818 - if (S_ISREG(inode->i_mode) && (masked_flags & F2FS_COMPR_FL)) { 1818 + if (masked_flags & F2FS_COMPR_FL) { 1819 1819 if (f2fs_disable_compressed_file(inode)) 1820 1820 return -EINVAL; 1821 1821 }