Hi,
I read an earlier thread where you said that it was
possible to manually walk a tree and add all
directories to an inotify watch descriptor. I wrote
some code to do this and the ioctl call fails on my
machine after adding 9,977 directories with ENOSPC.
I've attached a small repro case. Just point it at
the base of a large dir tree (e.g. inotify-r ~) to
use.
My kernel is 2.6.12-rc3 with the inotify 0.23 patch.
Let me know if you need more information.
Please cc my e-mail addr in all replies.
Thanks,
-bryan
On Tue, 2005-05-24 at 09:33 -0700, Bryan Wilkerson wrote:
> I read an earlier thread where you said that it was
> possible to manually walk a tree and add all
> directories to an inotify watch descriptor. I wrote
> some code to do this and the ioctl call fails on my
> machine after adding 9,977 directories with ENOSPC.
>
> I've attached a small repro case. Just point it at
> the base of a large dir tree (e.g. inotify-r ~) to
> use.
>
> My kernel is 2.6.12-rc3 with the inotify 0.23 patch.
> Let me know if you need more information.
This is intended. There is a per-user limit on the number of watches.
By default, that limit is 8192.
You can view and edit the number via
/sys/class/misc/inotify/max_user_watches
Best,
Robert Love
On Tue, 2005-05-24 at 18:52 +0200, Arjan van de Ven wrote:
> why isn't this an rlimit instead ?
Definitely could be.
Since inotify is built as a driver, the sysfs entry made sense, and it
sure is easier to implement.
But I'd have no problem with an rlimit. We don't seem to add those
frequently, though.
Robert Love
On Tue, 2005-05-24 at 12:35 -0400, Robert Love wrote:
> On Tue, 2005-05-24 at 09:33 -0700, Bryan Wilkerson wrote:
>
> > I read an earlier thread where you said that it was
> > possible to manually walk a tree and add all
> > directories to an inotify watch descriptor. I wrote
> > some code to do this and the ioctl call fails on my
> > machine after adding 9,977 directories with ENOSPC.
> >
> > I've attached a small repro case. Just point it at
> > the base of a large dir tree (e.g. inotify-r ~) to
> > use.
> >
> > My kernel is 2.6.12-rc3 with the inotify 0.23 patch.
> > Let me know if you need more information.
>
> This is intended. There is a per-user limit on the number of watches.
> By default, that limit is 8192.
>
> You can view and edit the number via
> /sys/class/misc/inotify/max_user_watches
why isn't this an rlimit instead ?