summaryrefslogtreecommitdiff
path: root/fs/bcachefs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-11-21 07:16:28 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:12 -0400
commite647369168e02a06ff5ee229cc14ad72b2f5ddfd (patch)
tree6d3b909842e259602a9321461db202546da203ff /fs/bcachefs
parent8812600c2953bf7e394ad11d44c7d71fbdd719cc (diff)
bcachefs: fix mempool double initialization
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r--fs/bcachefs/compress.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/bcachefs/compress.c b/fs/bcachefs/compress.c
index 42ae4cfdcb6b..6b5b61f10fcb 100644
--- a/fs/bcachefs/compress.c
+++ b/fs/bcachefs/compress.c
@@ -596,11 +596,13 @@ have_compressed:
goto out;
}
- ret = mempool_init_kmalloc_pool(
- &c->decompress_workspace,
- 1, decompress_workspace_size);
- if (ret)
- goto out;
+ if (!mempool_initialized(&c->decompress_workspace)) {
+ ret = mempool_init_kmalloc_pool(
+ &c->decompress_workspace,
+ 1, decompress_workspace_size);
+ if (ret)
+ goto out;
+ }
out:
pr_verbose_init(c->opts, "ret %i", ret);
return ret;