f2fs: compress: fix to assign cc.cluster_idx correctly
authorChao Yu <yuchao0@huawei.com>
Mon, 10 May 2021 09:30:32 +0000 (17:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:53 +0000 (10:29 +0200)
commit530d4804865432472587438707a513bbb6cda85d
tree889f7fb5d7fd8c918ecf9f79f2477d23da8e04ef
parent64acb100fe3beb5d20184d0ae3307235bd3555c4
f2fs: compress: fix to assign cc.cluster_idx correctly

[ Upstream commit 8bfbfb0ddd706b1ce2e89259ecc45f192c0ec2bf ]

In f2fs_destroy_compress_ctx(), after f2fs_destroy_compress_ctx(),
cc.cluster_idx will be cleared w/ NULL_CLUSTER, f2fs_cluster_blocks()
may check wrong cluster metadata, fix it.

Fixes: 4c8ff7095bef ("f2fs: support data compression")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/compress.c
fs/f2fs/data.c
fs/f2fs/f2fs.h