From e647369168e02a06ff5ee229cc14ad72b2f5ddfd Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 21 Nov 2018 07:16:28 -0500 Subject: [PATCH] bcachefs: fix mempool double initialization Signed-off-by: Kent Overstreet --- fs/bcachefs/compress.c | 12 +++++++----- 1 file 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;