Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e776a15d authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: fix to disable compression on directory



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

Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 60a370f9
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -3848,10 +3848,12 @@ static inline u64 f2fs_disable_compressed_file(struct inode *inode)

	if (!f2fs_compressed_file(inode))
		return 0;
	if (S_ISREG(inode->i_mode)) {
		if (get_dirty_pages(inode))
			return 1;
		if (fi->i_compr_blocks)
			return fi->i_compr_blocks;
	}

	fi->i_flags &= ~F2FS_COMPR_FL;
	stat_dec_compr_inode(inode);
+1 −1
Original line number Diff line number Diff line
@@ -1818,7 +1818,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)
	}

	if ((iflags ^ masked_flags) & F2FS_COMPR_FL) {
		if (S_ISREG(inode->i_mode) && (masked_flags & F2FS_COMPR_FL)) {
		if (masked_flags & F2FS_COMPR_FL) {
			if (f2fs_disable_compressed_file(inode))
				return -EINVAL;
		}