Re: [PATCH 2/2] radix-tree: Fix optimisation problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sep 25, 2016 10:59 AM, "Cedric Blancher" <cedric.blancher@xxxxxxxxx> wrote:
> >
> > The use of "int" is perfectly valid, since it's limited by
> > RADIX_TREE_MAP_SIZE, so it's going to be a small integer.
>
> A specific data type would be wise (aka radtr_mapsz_t) to prevent a
> disaster as SystemV had early during development.

Actually, you're right that the code is shit and shouldn't use an "int" there.

The value range is indeed just up to RADIX_TREE_MAP_SIZE, but since the code actually can get entries that are *not* sibling entries, it could overflow

The more I look at that particular piece of code, the less I like it. It's buggy shit. It needs to be rewritten entirely too actually check for sibling entries, not that ad-hoc arithmetic crap.

     Linus


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]