public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: markus@trippelsdorf.de
Cc: linux-kernel@vger.kernel.org, tj@kernel.org
Subject: Re: WARNING: at lib/idr.c:678 idr_find_slowpath+0x97/0xc0()
Date: Fri, 1 Mar 2013 13:31:59 -0800	[thread overview]
Message-ID: <20130301133159.0711f81a.akpm@linux-foundation.org> (raw)
In-Reply-To: <20130228090846.GA249@x4>

On Thu, 28 Feb 2013 10:08:46 +0100
markus@trippelsdorf.de wrote:

> Just hit the following warning on current git tree:
> 
> ------------[ cut here ]------------
> WARNING: at lib/idr.c:678 idr_find_slowpath+0x97/0xc0()
> Hardware name: System Product Name
> Pid: 12366, comm: okular Not tainted 3.8.0-09633-g2a7d2b9-dirty #312
> Call Trace:
>  [<ffffffff8105b7a0>] ? warn_slowpath_common+0x60/0xa0
>  [<ffffffff811bf557>] ? idr_find_slowpath+0x97/0xc0
>  [<ffffffff811249f2>] ? inotify_idr_find_locked+0x32/0x80
>  [<ffffffff810ecf7d>] ? fput+0x1d/0xc0
>  [<ffffffff811254d0>] ? sys_inotify_rm_watch+0x50/0xc0
>  [<ffffffff814c9f58>] ? int_signal+0x12/0x17
>  [<ffffffff814c9d52>] ? system_call_fastpath+0x16/0x1b

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.

  reply	other threads:[~2013-03-01 21:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28  9:08 WARNING: at lib/idr.c:678 idr_find_slowpath+0x97/0xc0() markus
2013-03-01 21:31 ` Andrew Morton [this message]
2013-03-01 21:35   ` Tejun Heo
2013-03-01 21:45     ` [PATCH] idr: remove WARN_ON_ONCE() on negative IDs Tejun Heo
2013-03-01 21:54     ` WARNING: at lib/idr.c:678 idr_find_slowpath+0x97/0xc0() Peter Hurley
2013-03-01 21:56       ` Tejun Heo
2013-03-01 22:10         ` Peter Hurley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130301133159.0711f81a.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus@trippelsdorf.de \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox