]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
lib/idr.c: Fix bug introduced by RCU fix
authorManfred Spraul <manfred@colorfullife.com>
Wed, 10 Dec 2008 17:17:06 +0000 (18:17 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 18 Dec 2008 17:13:36 +0000 (09:13 -0800)
commitb543708755a23b1de7ba140061b93bb17a5e22e4
treebfe2e33afc90576cd412f6f2eddaf980b4293108
parentfeb374144807f9d83d48930c3bae32005441230f
lib/idr.c: Fix bug introduced by RCU fix

commit 711a49a07f84f914aac26a52143f6e7526571143 upstream.

The last patch to lib/idr.c caused a bug if idr_get_new_above() was
called on an empty idr.

Usually, nodes stay on the same layer.  New layers are added to the top
of the tree.

The exception is idr_get_new_above() on an empty tree: In this case, the
new root node is first added on layer 0, then moved upwards.  p->layer
was not updated.

As usual: You shall never rely on the source code comments, they will
only mislead you.

Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
lib/idr.c