From: Derrick Stolee <stolee@gmail.com>
To: Jeff King <peff@peff.net>, git@vger.kernel.org
Cc: Patrick Steinhardt <ps@pks.im>
Subject: Re: [PATCH 1/3] bloom: make bloom-filter slab initialization idempotent
Date: Wed, 1 Jul 2026 09:53:29 -0400 [thread overview]
Message-ID: <f7384ae3-bcd3-4191-9ff9-1ab86701c762@gmail.com> (raw)
In-Reply-To: <20260701063942.GA2580331@coredump.intra.peff.net>
On 7/1/2026 2:39 AM, Jeff King wrote:
> Before using any of the commit-graph bloom-filter code, somebody needs
> to call init_bloom_filters(). This initializes the commit-slab we use
> for storing filter information. But we don't want to call it twice
> (without a matching deinit call in the middle), since it overwrites the
> existing slab pointers, leaking the old values.
...
> This patch takes a smaller and more direct route to just dealing with
> the potential leak issue.
> +static int bloom_filter_slab_initialized;
> void init_bloom_filters(void)
> {
> + if (bloom_filter_slab_initialized)
> + return;
> init_bloom_filter_slab(&bloom_filters);
> + bloom_filter_slab_initialized = 1;
> }
> {
> deep_clear_bloom_filter_slab(&bloom_filters, free_one_bloom_filter);
> + bloom_filter_slab_initialized = 0;
> }
This patch looks like the right fix.
Thanks,
-Stolee
next prev parent reply other threads:[~2026-07-01 13:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 6:35 [PATCH 0/3] bloom-related leak fixes Jeff King
2026-07-01 6:39 ` [PATCH 1/3] bloom: make bloom-filter slab initialization idempotent Jeff King
2026-07-01 13:53 ` Derrick Stolee [this message]
2026-07-01 15:50 ` Junio C Hamano
2026-07-01 6:40 ` [PATCH 2/3] revision: avoid leaking bloom keyvecs with multiple traversals Jeff King
2026-07-01 8:26 ` Patrick Steinhardt
2026-07-01 14:21 ` Derrick Stolee
2026-07-01 15:52 ` Junio C Hamano
2026-07-01 6:42 ` [PATCH 3/3] line-log: drop extra copy of range with bloom filters Jeff King
2026-07-01 14:32 ` [PATCH 0/3] bloom-related leak fixes Derrick Stolee
2026-07-01 17:33 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7384ae3-bcd3-4191-9ff9-1ab86701c762@gmail.com \
--to=stolee@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.