Re: [v2] libceph: Reject osdmaps advertising pools of unsupported types
Alex Markuze <[email protected]> Tue, 7 Jul 2026 09:45:33 +0000
| Newsgroups | org.kernel.vger.ceph-devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Raphael,
NACK for now. Thanks for the patch, but I have some concerns
that need a v2:
1. [major] net/ceph/osdmap.c:1372: Memory leak: erase_pg_pool doesn't free the pool
`erase_pg_pool(&map->pg_pools, pi)` removes `pi` from the rbtree
but doesn't free `pi->name` or `pi` itself. The node is orphaned —
`ceph_osdmap_destroy` won't find it, and nothing else holds a
reference.
Suggested fix: Use `__remove_pg_pool(&map->pg_pools, pi)` instead,
which calls `erase_pg_pool` then `kfree(pi->name)` and `kfree(pi)`
— exactly the pattern at line 2059 for old pool removal.
2. [nit] net/ceph/osdmap.c:823: Missing newline in pr_warn_ratelimited
Format string is missing trailing `\n`. Every other `pr_warn` in
this function ends with one (lines 810, 814).
Suggested fix: `pr_warn_ratelimited("got unsupported pool type
%u\n", pi->type)`
erase_pg_pool leaks the pool struct; use __remove_pg_pool instead. Also missing \n in pr_warn_ratelimited.
--
Alex Markuze