From owner-cvs-all@FreeBSD.ORG Mon Jul 7 09:31:14 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1461106567B; Mon, 7 Jul 2008 09:31:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CD8B38FC16; Mon, 7 Jul 2008 09:31:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m679VELA001613; Mon, 7 Jul 2008 09:31:14 GMT (envelope-from kib@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m679VEhp001612; Mon, 7 Jul 2008 09:31:14 GMT (envelope-from kib@repoman.freebsd.org) Message-Id: <200807070931.m679VEhp001612@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to kib@repoman.freebsd.org using -f From: Konstantin Belousov Date: Mon, 7 Jul 2008 09:30:11 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern kern_event.c kern_fork.c src/sys/sys event.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 09:31:15 -0000 kib 2008-07-07 09:30:11 UTC FreeBSD src repository Modified files: sys/kern kern_event.c kern_fork.c sys/sys event.h Log: SVN rev 180340 on 2008-07-07 09:30:11Z by kib The kqueue_register() function assumes that it is called from the top of the syscall code and acquires various event subsystem locks as needed. The handling of the NOTE_TRACK for EVFILT_PROC is currently done by calling the kqueue_register() from filt_proc() filter, causing recursive entrance of the kqueue code. This results in the LORs and recursive acquisition of the locks. Implement the variant of the knote() function designed to only handle the fork() event. It mostly copies the knote() body, but also handles the NOTE_TRACK, removing the handling from the filt_proc(), where it causes problems described above. The function is called from the fork1() instead of knote(). When encountering NOTE_TRACK knote, it marks the knote as influx and drops the knlist and kqueue lock. In this context call to kqueue_register is safe from the problems. An error from the kqueue_register() is reported to the observer as NOTE_TRACKERR fflag. PR: 108201 Reviewed by: jhb, Pramod Srinivasan (previous version) Discussed with: jmg Tested by: pho MFC after: 2 weeks Revision Changes Path 1.122 +67 -15 src/sys/kern/kern_event.c 1.294 +2 -4 src/sys/kern/kern_fork.c 1.39 +1 -0 src/sys/sys/event.h