From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 21:12:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4991106564A; Sat, 14 Feb 2009 21:12:24 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9323B8FC1E; Sat, 14 Feb 2009 21:12:24 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1ELCOaX030475; Sat, 14 Feb 2009 21:12:24 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1ELCOJg030474; Sat, 14 Feb 2009 21:12:24 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200902142112.n1ELCOJg030474@svn.freebsd.org> From: Joe Marcus Clarke Date: Sat, 14 Feb 2009 21:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188613 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 21:12:25 -0000 Author: marcus (doc,ports committer) Date: Sat Feb 14 21:12:24 2009 New Revision: 188613 URL: http://svn.freebsd.org/changeset/base/188613 Log: Change two KASSERTS to printfs and simple returns. Stress testing has revealed that a process' current working directory can be VBAD if the directory is removed. This can trigger a panic when procstat -f PID is run. Tested by: pho Discovered by: phobot Reviewed by: kib Approved by: kib Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Feb 14 21:08:40 2009 (r188612) +++ head/sys/kern/kern_descrip.c Sat Feb 14 21:12:24 2009 (r188613) @@ -2532,7 +2532,12 @@ export_vnode_for_osysctl(struct vnode *v kif->kf_fd = type; kif->kf_type = KF_TYPE_VNODE; /* This function only handles directories. */ - KASSERT(vp->v_type == VDIR, ("export_vnode_for_osysctl: vnode not directory")); + if (vp->v_type != VDIR) { + printf("export_vnode_for_osysctl: vnode not directory: %d\n", + vp->v_type); + vrele(vp); + return (ENOTDIR); + } kif->kf_vnode_type = KF_VTYPE_VDIR; /* @@ -2779,7 +2784,12 @@ export_vnode_for_sysctl(struct vnode *vp kif->kf_fd = type; kif->kf_type = KF_TYPE_VNODE; /* This function only handles directories. */ - KASSERT(vp->v_type == VDIR, ("export_vnode_for_sysctl: vnode not directory")); + if (vp->v_type != VDIR) { + printf("export_vnode_for_sysctl: vnode not directory: %d\n", + vp->v_type); + vrele(vp); + return (ENOTDIR); + } kif->kf_vnode_type = KF_VTYPE_VDIR; /*