Re: [PATCH RESEND] bcache: Release the cache kobject when cache_alloc() fails
From: Krzysztof Kozlowski
Date: Tue Nov 03 2026 - 05:57:34 EST
On Tue, 03 Nov 2026 09:46:43 +0000, Wentao Liang wrote:
> cache_alloc() initializes ca->kobj with kobject_init(), which takes the
> initial reference on the kobject, and takes a reference on the bcache
> module. The object is released later by bch_cache_release(), which also
> drops the block device, puts the super block folio, frees ca and drops
> the module reference.
>
> When one of the allocations in cache_alloc() fails, the function frees
> only the buffers it managed to allocate and returns an error.
> register_cache() then only calls fput() on the block device and returns,
> so the reference taken by kobject_init() is never dropped: ca is leaked
> together with the super block folio and the module reference. The
> comment on that path still claims that ca->kobj is not initialized, but
> kobject_init() is the first thing cache_alloc() does.
>
> Put ca->kobj on that path so that bch_cache_release() runs and releases
> everything. bch_cache_release() frees ca->buckets and ca->prio_buckets
> as well, so clear those pointers in cache_alloc() after freeing them, and
> drop the module_put() from the error path because the module reference is
> now released by bch_cache_release(). Skip the bucket page free in
> bch_cache_release() when cache_alloc() failed before allocating them.
>
> Fixes: cafe56359144 ("bcache: A block layer cache")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
> ---
> drivers/md/bcache/super.c | 22 ++++++++++++++--------
> 1 file changed, 14 insertions(+), 8 deletions(-)
>
Multiple things here:
1. Your team ignored completely previous feedback. Multiple times.
2. You use multiple identities with this email address, thus I doubt that we
speak with an actual person.
3. Your bot does not even bother running checkpatch, right?
4. Nothing of this was reproduced nor tested.
5. Finally, the same feedback:
You sent multiple independent patches, to multiple independent
subsystems. The amount of these patches clearly suggest this was
AI generated and most likely not tested.
More importantly, you sent all this work without properly organizing
relevant patches into patchsets. This makes reviewing difficult
and might cause multiple reviewers to address the same issue.
Replying to the entire set is impossible and requires handling each
patch independently, instead of applying or discarding the set.
Maintainers also won't see the bigger picture of your work. Quite
worrying.
This is on the verge of hostile patch: bomb us with so many
contributions, we won't be able to handle them in efficient manner,
like responding ONCE to ask you to slow down. Considering all this
is untested and LLM generated, I have even more doubts whether this
should be considered for review.
Please read kernel documentation BEFORE posting more work. It will
explain you how to identify subsystems, how to organize your work per
subsystem (so a patchset grouping multiple patches with a short cover
letter), how to document the issue discovery method and what was
or was not tested.
Best regards,
Krzysztof