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
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.

johannes

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

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

int main()
{
int fd;
int wd1, wd2;
int ret;

fd = inotify_init();

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

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

while (1) {
wd1 = inotify_add_watch(fd, "/tmp", IN_ALL_EVENTS);

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

wd2 = inotify_add_watch(fd, "/", IN_ALL_EVENTS);

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

ret = inotify_rm_watch(fd, wd1);
if (ret < 0) {
perror("inotify_rm_watch wd1");
break;
}
ret = inotify_rm_watch(fd, wd2);
if (ret < 0) {
perror("inotify_rm_watch wd2");
break;
}
}
}

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-08-25 14:22    [W:0.107 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site