diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-11-21 07:16:28 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:12 -0400 |
commit | e647369168e02a06ff5ee229cc14ad72b2f5ddfd (patch) | |
tree | 6d3b909842e259602a9321461db202546da203ff /fs/bcachefs/compress.c | |
parent | 8812600c2953bf7e394ad11d44c7d71fbdd719cc (diff) | |
download | linux-e647369168e02a06ff5ee229cc14ad72b2f5ddfd.tar.gz linux-e647369168e02a06ff5ee229cc14ad72b2f5ddfd.tar.bz2 linux-e647369168e02a06ff5ee229cc14ad72b2f5ddfd.zip |
bcachefs: fix mempool double initialization
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/compress.c')
-rw-r--r-- | fs/bcachefs/compress.c | 12 |
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; |