public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John McCutchan <ttb@tentacle.dhs.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Reuben Farrelly <reuben-lkml@reub.net>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, Robert Love <rml@novell.com>
Subject: Re: Inotify problem [was Re: 2.6.13-rc6-mm1]
Date: Thu, 25 Aug 2005 09:40:53 -0400	[thread overview]
Message-ID: <1124977253.5039.13.camel@vertex> (raw)
In-Reply-To: <1124972307.6307.30.camel@localhost>

On Thu, 2005-08-25 at 14:18 +0200, Johannes Berg wrote:
> Hi,
> 
> > I have also observed another problem with inotify with dovecot - so I spoke 
> > with Johannes Berg who wrote the inotify code in dovecot.  He suggested I post 
> > here to LKML since his opinion is that this to be a kernel bug.
> 
> Allow me to jump in at this point. The small tool below triggers this
> problem for Reuben (confirmed via private mail) but works fine for me on
> 2.6.13-rc6.

On 2.6.13-rc7 the test program fails. It always fails when a wd == 1024.
If I skip inotify_rm_watch when wd == 1024, it will fail at wd == 2048.
It seems the idr layer has an aversion to multiples of 1024.

When I run your test program I get this a lot:

inotify_add_watch returned wd1 5
inotify_add_watch returned wd2 6
inotify_add_watch returned wd1 6
inotify_add_watch returned wd2 7

The pattern of 

add_watch wd1 = X
add_watch wd2 = X+1
rm_watch X
rm_watch X+1
add_watch wd1 = X+1
add_watch wd2 = X+2

Should never happen. We tell the idr layer to always give us something
bigger than the last wd we received.

Also, idr_get_new_above doesn't work all the time. Under 2.6.13-rc7, I
added this to inotify.c:359:

if (ret <= dev->last_wd) {
    printk(KERN_INFO "idr_get_new_above returned <= dev->last_wd\n");
}

I get that message a lot. I know I have said this before (and was wrong)
but I think the idr layer is busted.

-- 
John McCutchan <ttb@tentacle.dhs.org>

  reply	other threads:[~2005-08-25 13:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.h7s290f.i6qp37@ifi.uio.no>
     [not found] ` <fa.e1uvbs1.l407h7@ifi.uio.no>
2005-08-25 10:07   ` Inotify problem [was Re: 2.6.13-rc6-mm1] Reuben Farrelly
2005-08-25 12:18     ` Johannes Berg
2005-08-25 13:40       ` John McCutchan [this message]
2005-08-25 13:47         ` Robert Love
2005-08-25 14:03           ` Johannes Berg
2005-08-25 14:06             ` John McCutchan
2005-08-25 14:13               ` Johannes Berg
2005-08-25 14:39                 ` John McCutchan
2005-08-25 14:13           ` John McCutchan
2005-08-25 14:41             ` Johannes Berg
2005-08-25 15:16               ` John McCutchan
2005-08-25 13:50         ` Johannes Berg
2005-08-25 14:03           ` John McCutchan
2005-08-25 13:33     ` John McCutchan
2005-08-25 15:18       ` Robert Love
2005-08-25 18:54         ` George Anzinger
2005-08-25 19:03           ` Johannes Berg
2005-08-25 19:06             ` John McCutchan
2005-08-25 19:04           ` John McCutchan
2005-08-25 23:10             ` George Anzinger
2005-08-25 23:20               ` Johannes Berg
2005-08-26 17:03 Jim Houston
2005-08-26 17:52 ` John McCutchan
2005-08-26 17:56   ` Robert Love

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=1124977253.5039.13.camel@vertex \
    --to=ttb@tentacle.dhs.org \
    --cc=akpm@osdl.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reuben-lkml@reub.net \
    --cc=rml@novell.com \
    /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