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 <[email protected]> * * 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; } } }
Attachment:
signature.asc
Description: This is a digitally signed message part
- Follow-Ups:
- Re: Inotify problem [was Re: 2.6.13-rc6-mm1]
- From: John McCutchan <[email protected]>
- Re: Inotify problem [was Re: 2.6.13-rc6-mm1]
- References:
- Inotify problem [was Re: 2.6.13-rc6-mm1]
- From: Reuben Farrelly <[email protected]>
- Inotify problem [was Re: 2.6.13-rc6-mm1]
- Prev by Date: Re: [PATCH][RESEND] don't allow sys_readahead() on files opened with O_DIRECT
- Next by Date: serial port multiplexing
- Previous by thread: Inotify problem [was Re: 2.6.13-rc6-mm1]
- Next by thread: Re: Inotify problem [was Re: 2.6.13-rc6-mm1]
- Index(es):