]> git.baikalelectronics.ru Git - kernel.git/commit
idr: remove WARN_ON_ONCE() on negative IDs
authorTejun Heo <tj@kernel.org>
Fri, 8 Mar 2013 20:43:30 +0000 (12:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 8 Mar 2013 23:05:34 +0000 (15:05 -0800)
commit42c8e5acb9875a4b75cce33d34999966e65f09fa
treeb1f8c8a5fde730b2e3c71239e125e451df039fa5
parentbd24663a1e351e0a120a7c8cef168261a989413f
idr: remove WARN_ON_ONCE() on negative IDs

idr_find(), idr_remove() and idr_replace() used to silently ignore the
sign bit and perform lookup with the rest of the bits.  The weird behavior
has been changed such that negative IDs are treated as invalid.  As the
behavior change was subtle, WARN_ON_ONCE() was added in the hope of
determining who's calling idr functions with negative IDs so that they can
be examined for problems.

Up until now, all two reported cases are ID number coming directly from
userland and getting fed into idr_find() and the warnings seem to cause
more problems than being helpful.  Drop the WARN_ON_ONCE()s.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: <markus@trippelsdorf.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/idr.c