Skip to content

Commit aa57697

Browse files
chaseyuJaegeuk Kim
authored andcommitted
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 <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 9b6ed14 commit aa57697

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

fs/f2fs/f2fs.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3849,10 +3849,12 @@ static inline u64 f2fs_disable_compressed_file(struct inode *inode)
38493849

38503850
if (!f2fs_compressed_file(inode))
38513851
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+
}
38563858

38573859
fi->i_flags &= ~F2FS_COMPR_FL;
38583860
stat_dec_compr_inode(inode);

fs/f2fs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)
18151815
}
18161816

18171817
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) {
18191819
if (f2fs_disable_compressed_file(inode))
18201820
return -EINVAL;
18211821
}

0 commit comments

Comments
 (0)