On Wed, Jan 23, 2013 at 7:20 AM, gertk <gkar...@gmail.com> wrote:
> Last login: Wed Jan 23 07:42:00 2013 from 10.100.201.5
> root@node1:~# gnt-instance add -o snf-image+default --os-parameters
> img_passwd=Password,img_format=extdump,img_id=debian_base-6.0-5-x86_64 -t
> plain --disk=0:size=10G --net 0:link=prv5 testvm1
> Unhandled protocol error while talking to the master daemon:
> Caught exception: Cannot initialize new instance of inotify, Errno=Too many
> open files (EMFILE)
Could you check which processes had the inotify file descriptors open, here?
--
--
--
First, thanks to Eugene and Adar for reporting and investigation.
I have had some time now to debug this and I found the reason for the bug. Obviously something went wrong during
the port of the patch series mentioned above from mainline to ubuntu kernel:
There is the function fsnotify_destroy() which is never called in ubuntu. But this function ensures
that all pending events are flushed and thereby ref counts on a fsnotify group held by those events are released.
So what has to be done is call fsnotify_destroy in inotify_release(). Otherwise there will always be references held to
the inotify group and the group will never get destroyed - which sooner or later results in a number of alive groups that
exceeds the allowed max number.
The same flaw can be found in the fanotify code. I will attach a patch that should fix the ref counts for both inotify and fanotify.