On Tue, Feb 24, 2009 at 09:38:00PM +0000, Al Viro wrote: > On Tue, Feb 24, 2009 at 01:05:23PM -0800, Andrew Morton wrote: > > > > We have webcams that take photos every 5 minutes. I run a daemon > > > that detects the creation of a new webcam photo then makes a thumbnail > > > of it. Eventually it stopped working. I figured out that I could > > > not create new watches: inotify_add_watch reported "No space left on device". > > > I create all the watches with the ONESHOT parameter so they are deleted > > > as soon as they are triggered. When I make it display the watch number > > > it's always 3. A new watch is added only when the old watch has been > > > triggered. inotify isn't recovering the memory from deleted watches. IN_ONESHOT means that they will be *removed* as they are triggered. You still have to call put_inotify_watch() from your ->handle_event() when you get IN_ONESHOT in the mask. IOW, check your ->handle_event(); unless it does that put_inotify_watch(), you are leaking. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html