]> git.kernelconcepts.de Git - karo-tx-linux.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)
commit2e1c9b2867656ff9a469d23e1dfe90cf77ec0c72
treeb1f8c8a5fde730b2e3c71239e125e451df039fa5
parent7880639c3e4fde5953ff243ee52204ddc5af641b
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