Date: Mon, 9 Feb 2009 12:22:49 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r188389 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/fifofs Message-ID: <200902091222.n19CMnfR059846@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Feb 9 12:22:49 2009 New Revision: 188389 URL: http://svn.freebsd.org/changeset/base/188389 Log: MFC r187715: The kernel may do unbalanced calls to fifo_close() for fifo vnode, without corresponding number of fifo_open(). This causes assertion failure in fifo_close() due to vp->v_fifoinfo being NULL for kernel with INVARIANTS, or NULL pointer dereference otherwise. In fact, we may ignore excess calls to fifo_close() without bad consequences. Turn KASSERT() into the return, and print warning for now. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/fifofs/fifo_vnops.c Modified: stable/7/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- stable/7/sys/fs/fifofs/fifo_vnops.c Mon Feb 9 11:42:23 2009 (r188388) +++ stable/7/sys/fs/fifofs/fifo_vnops.c Mon Feb 9 12:22:49 2009 (r188389) @@ -424,7 +424,10 @@ fifo_close(ap) struct fifoinfo *fip = vp->v_fifoinfo; ASSERT_VOP_LOCKED(vp, "fifo_close"); - KASSERT(fip != NULL, ("fifo_close: no v_fifoinfo")); + if (fip == NULL) { + printf("fifo_close: no v_fifoinfo %p\n", vp); + return (0); + } if (ap->a_fflag & FREAD) { fip->fi_readers--; if (fip->fi_readers == 0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902091222.n19CMnfR059846>