Messages in this thread | | | Date | Fri, 1 Mar 2013 13:35:11 -0800 | From | Tejun Heo <> | Subject | Re: WARNING: at lib/idr.c:678 idr_find_slowpath+0x97/0xc0() |
| |
Hello, Andrew.
On Fri, Mar 01, 2013 at 01:31:59PM -0800, Andrew Morton wrote: > okluar passed a negative `wd' into inotify_rm_watch()? > > I wonder why it did that. I doubt if inotify_add_watch() ever returns > negative descriptors, in which case I expect that okular's call to > inotify_add_watch() returned -1 and an errno and okular forgot to check > it, and later passed that -1 back into inotify_rm_watch(). > > Anyway, I guess we need to make inotify_add_watch() refuse to return > negative descriptors (presumably this is already the case due to idr > internals) and make inotify_rm_watch() trap negative values of `wd' up > front. > > I wonder how many other such gremlins the IDR checking has added.
The WARN_ON() is just for cases where someone might be doing something crazy with the previous behavior of ignoring high bit. Maybe I was being overly paranoid and we should just drop it from idr_find().
Thanks.
-- tejun
| |