lkml.org 
[lkml]   [2005]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Inotify problem [was Re: 2.6.13-rc6-mm1]
From
Date
On Thu, 2005-08-25 at 10:06 -0400, John McCutchan wrote:
> > it fails on 2.6.13-rc6 as soon as the device is full and doesn't hold
> > any more directories.

Obviously this wasn't true, I was hitting the 8192 watches limit and
misinterpreted the error message. I just tested up to 100000 watches
with this program.

> Could you send me the new test program?

Below.

johannes

/* Author: Johannes Berg <johannes@sipsolutions.net>
*
* This is another small inotify test program that simply
* repeatedly adds watches.
*/

#include <stdio.h>
#include <linux/inotify.h>
#include <linux/inotify-syscalls.h>

int main()
{
int fd;
int wd1, wd2;
int ret, i = 0;
char buf[1024];

fd = inotify_init();

if (fd < 0)
perror("inotify_init");

printf("inotify_init returned fd %d\n", fd);

mkdir("/tmp/inotify-test-dir-rm-rf-this", 0777);

while (1) {
i++;
snprintf(buf,sizeof(buf),"/tmp/inotify-test-dir-rm-rf-this/%d",i>>10);
mkdir(buf,0777);
snprintf(buf,sizeof(buf),"/tmp/inotify-test-dir-rm-rf-this/%d/%d",i>>10,i);
mkdir(buf, 0777);
wd1 = inotify_add_watch(fd, buf, IN_ALL_EVENTS);

if (wd1 < 0) {
perror("inotify_add_watch");
break;
}
printf("inotify_add_watch returned wd1 %d\n", wd1);
}
}

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-08-25 16:15    [W:0.060 / U:0.480 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site