lkml.org 
[lkml]   [2012]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] btree: Fix tree corruption in btree_get_prev()
On Wed, 6 Jun 2012 17:44:20 -0700 Roland Dreier <roland@kernel.org> wrote:

> On Wed, Jun 6, 2012 at 4:36 PM, Roland Dreier <roland@kernel.org> wrote:
> > On the other hand, your change makes me think we don't
> > even need a separate iterator (and we can avoid the variable
> > length array declaration)
>
> FWIW with that change on top of my patch, I see
>
> add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-123 (-123)
> function old new delta
> btree_get_prev 646 523 -123
>
> on x86-64, so avoiding the variable length array is definitely
> worth something.
>
> So the issue for me is whether messing with the caller's
> __key storage is OK, or if it's worth having a temporary
> local variable.
>

Sometimes altering the caller's *__key when lookup fails is pretty rude
behavior :(

Perhaps we could add an arg to btree_get_prev(), provide it with
separate input and output key pointers?


\
 
 \ /
  Last update: 2012-06-07 04:01    [from the cache]
©2003-2011 Jasper Spaans