summaryrefslogtreecommitdiff
path: root/fs/f2fs/compress.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2021-05-25 11:39:35 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2021-06-23 01:09:34 -0700
commitc61404153eb683da9c35aad133131554861ed561 (patch)
treeb68a9fc306cdc2bd28d39a76a6b63117a8be92f3 /fs/f2fs/compress.c
parent8f1d49832636d514e949b29ce64370ebebf6d6d2 (diff)
f2fs: introduce FI_COMPRESS_RELEASED instead of using IMMUTABLE bit
Once we release compressed blocks, we used to set IMMUTABLE bit. But it turned out it disallows every fs operations which we don't need for compression. Let's just prevent writing data only. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/compress.c')
-rw-r--r--fs/f2fs/compress.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
index bec92ff5ee7d..1c3e98085591 100644
--- a/fs/f2fs/compress.c
+++ b/fs/f2fs/compress.c
@@ -928,7 +928,8 @@ static int __f2fs_cluster_blocks(struct inode *inode,
}
f2fs_bug_on(F2FS_I_SB(inode),
- !compr && ret != cluster_size && !IS_IMMUTABLE(inode));
+ !compr && ret != cluster_size &&
+ !is_inode_flag_set(inode, FI_COMPRESS_RELEASED));
}
fail:
f2fs_put_dnode(&dn);