summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJingbo Xu <jefflexu@linux.alibaba.com>2023-08-22 14:05:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-09-13 10:52:58 +0300
commit9f9e7fea0ff2ad237ceda88597d2a5936d67c4f0 (patch)
treeec197e00df2ab73c9cdc075e6abf3858c94d228e
parentd3cfa44164688a076e8b476cafb5df87d07cfa63 (diff)
downloadlinux-9f9e7fea0ff2ad237ceda88597d2a5936d67c4f0.tar.xz
erofs: release ztailpacking pclusters properly
[ Upstream commit 91b1ad0815fbb1095c8b9e8a2bf4201186afe304 ] Currently ztailpacking pclusters are chained with FOLLOWED_NOINPLACE and not recorded into the managed_pslots XArray. After commit 7674a42f35ea ("erofs: use struct lockref to replace handcrafted approach"), ztailpacking pclusters won't be freed with erofs_workgroup_put() anymore, which will cause the following issue: BUG erofs_pcluster-1 (Tainted: G OE ): Objects remaining in erofs_pcluster-1 on __kmem_cache_shutdown() Use z_erofs_free_pcluster() directly to free ztailpacking pclusters. Fixes: 7674a42f35ea ("erofs: use struct lockref to replace handcrafted approach") Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Reviewed-by: Chao Yu <chao@kernel.org> Link: https://lore.kernel.org/r/20230822110530.96831-1-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/erofs/zdata.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 9c9350eb1704..9bfdb4ad7c76 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1412,7 +1412,10 @@ static void z_erofs_decompress_queue(const struct z_erofs_decompressqueue *io,
owned = READ_ONCE(be.pcl->next);
z_erofs_decompress_pcluster(&be, io->eio ? -EIO : 0);
- erofs_workgroup_put(&be.pcl->obj);
+ if (z_erofs_is_inline_pcluster(be.pcl))
+ z_erofs_free_pcluster(be.pcl);
+ else
+ erofs_workgroup_put(&be.pcl->obj);
}
}