From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 29 11:17:11 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90123106566C; Thu, 29 Jan 2009 11:17:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E0258FC18; Thu, 29 Jan 2009 11:17:11 +0000 (UTC) (envelope-from kib@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 n0TBHBsU052643; Thu, 29 Jan 2009 11:17:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0TBHB8n052642; Thu, 29 Jan 2009 11:17:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901291117.n0TBHB8n052642@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 29 Jan 2009 11:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187890 - in stable/7/sys: . contrib/pf dev/cxgb fs/pseudofs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2009 11:17:12 -0000 Author: kib Date: Thu Jan 29 11:17:11 2009 New Revision: 187890 URL: http://svn.freebsd.org/changeset/base/187890 Log: MFC r186565: When the insmntque() in the pfs_vncache_alloc() fails, vop_reclaim calls pfs_vncache_free() that removes pvd from the list, while it is not yet put on the list. Prevent the invalid removal from the list by clearing pvd_next and pvd_prev for the newly allocated pvd, and only move pfs_vncache list head when the pvd was at the head. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/pseudofs/pseudofs_vncache.c Modified: stable/7/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- stable/7/sys/fs/pseudofs/pseudofs_vncache.c Thu Jan 29 11:13:03 2009 (r187889) +++ stable/7/sys/fs/pseudofs/pseudofs_vncache.c Thu Jan 29 11:17:11 2009 (r187890) @@ -149,6 +149,7 @@ retry: /* nope, get a new one */ MALLOC(pvd, struct pfs_vdata *, sizeof *pvd, M_PFSVNCACHE, M_WAITOK); + pvd->pvd_next = pvd->pvd_prev = NULL; error = getnewvnode("pseudofs", mp, &pfs_vnodeops, vpp); if (error) { FREE(pvd, M_PFSVNCACHE); @@ -246,7 +247,7 @@ pfs_vncache_free(struct vnode *vp) pvd->pvd_next->pvd_prev = pvd->pvd_prev; if (pvd->pvd_prev) pvd->pvd_prev->pvd_next = pvd->pvd_next; - else + else if (pfs_vncache == pvd) pfs_vncache = pvd->pvd_next; --pfs_vncache_entries; mtx_unlock(&pfs_vncache_mutex);