In article <pine.neb.4.64.1601061305290.19...@pokey.whooppee.com>, Paul Goyette <p...@whooppee.com> wrote: > >Yeah, this is workable, even if it is a HACK ! :) > >The attached patch borrows extensively from fd_free() routine in >kern/kern_descrip.c > >Let me know if this looks "good enough" and I will commit it. (I'll >also update the BUGS section of the man-page to describe the hack.) > >FWIW, I have tested with log-file fd values of 1 and 4, while the >/dev/filemon fd is always 3. In the "1" case the patch correctly >returned EINVAL (it would cause a deadlock), while the "4" case >succeeded and no deadlock occurred.
As a temporary hack it is probably good enough. Longer term filemon should be removed/rewritten, and the close ordering problem should be handled. christos