LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Clem Taylor" <clem.taylor@gmail.com>
Cc: linux-kernel@vger.kernel.org, Amy Griffis <amy.griffis@hp.com>
Subject: Re: inotify_add_watch() returning ENOSPC in 2.6.24 [watch descriptor leak?]
Date: Wed, 6 Feb 2008 01:51:03 -0800	[thread overview]
Message-ID: <20080206015103.9a0f4069.akpm@linux-foundation.org> (raw)
In-Reply-To: <ecb4efd10802051749n6a626e84k3ac8210aa2b5a446@mail.gmail.com>

On Tue, 5 Feb 2008 20:49:42 -0500 "Clem Taylor" <clem.taylor@gmail.com> wrote:

> I'm trying to move a MIPS based embedded system from 2.6.16.16 to
> 2.6.24. Most things seem to be working, but I'm having troubles with
> inotify. The code is using inotify to detect a file written to /tmp
> (tmpfs). The writer creates a file with a temporary name and then
> rename()s the tmp file over the file I'm monitoring.
> 
> With 2.6.16.16, everything works fine, but with 2.6.24, the inotify
> process runs for a while (~100 events) and then inotify_add_watch()
> returns ENOSPC. Once this happens, I can't add new watches, even if I
> kill the process and restart it. fs.inotify.max_user_instances and
> fs.inotify.max_user_watches are both 128, so I'd imagine I'm hitting
> this limit. For some reason the watches aren't getting cleaned up
> (even after the process is killed).
> 
> In a loop, the code is doing:
>     wd = inotify_add_watch(fd, file, IN_CLOSE_WRITE|IN_DELETE_SELF|IN_ONESHOT);
>     blocking read on notify fd
> 
> Has something changed in the inotify() API since 2.6.16.16, or could
> this be a leak?
> 

Good bug report, thanks.  That code was significantly altered in June 2006
and perhaps something broke.

It's a bit hard to find people who work on inotify, I'm afraid.  If you had
the time to come up with a script or program which demonstrates the bug,
that would be super-helpful?

  reply	other threads:[~2008-02-06  9:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06  1:49 Clem Taylor
2008-02-06  9:51 ` Andrew Morton [this message]
2008-02-06 19:40   ` Clem Taylor
2008-02-07  3:04     ` Amy Griffis
2008-02-07 18:54     ` Ulisses Furquim
2008-02-07 21:24       ` Clem Taylor
2008-02-07 21:44         ` Andrew Morton

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=20080206015103.9a0f4069.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=amy.griffis@hp.com \
    --cc=clem.taylor@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: inotify_add_watch() returning ENOSPC in 2.6.24 [watch descriptor leak?]' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).