Re: [PATCH] fs/notify/inotify: decrement user inotify count on close

From: Alex Riesen
Date: Sun Jul 26 2009 - 11:47:08 EST


On Thu, Jul 2, 2009 at 14:14, Eric Paris<eparis@xxxxxxxxxx> wrote:
> On Wed, 2009-07-01 at 21:56 -0700, Keith Packard wrote:
>> The per-user inotify_devs value is incremented each time a new file is
>> allocated, but never decremented. This led to inotify_init failing after a
>> limited number of calls.
>>
>> Signed-off-by: Keith Packard <keithp@xxxxxxxxxx>
>
> Thanks, I will push to Linus later today, sorry about the regression!
>

Hmm... Either the patch wasn't enough, or it was broken again.
On v2.6.31-rc4, I get this:

# echo 10 >/proc/sys/fs/inotify/max_user_watches
# inotifywatch -r /usr/lib # generate watches up to the limit
Establishing watches...
Failed to watch /bin; upper limit on inotify watches reached!
Please increase the amount of inotify watches allowed per user via
`/proc/sys/fs/inotify/max_user_watches'.
# inotifywatch /bin/true # just one watch for just one file

AFAIU, the second inotifywatch should work, and the watches of the first,
failed, run must be cleared.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/