From owner-svn-src-head@FreeBSD.ORG Sun Jul 29 20:04:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B334106566C; Sun, 29 Jul 2012 20:04:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 167B28FC1A; Sun, 29 Jul 2012 20:04:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6TK49iF095467; Sun, 29 Jul 2012 20:04:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6TK496t095465; Sun, 29 Jul 2012 20:04:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201207292004.q6TK496t095465@svn.freebsd.org> From: Alexander Motin Date: Sun, 29 Jul 2012 20:04:09 +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: r238892 - head/sys/geom 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: Sun, 29 Jul 2012 20:04:10 -0000 Author: mav Date: Sun Jul 29 20:04:09 2012 New Revision: 238892 URL: http://svn.freebsd.org/changeset/base/238892 Log: Partially revert r238886 in part of GEOM_VFS spoiling. This change triggered interesting foot shooting condition in GEOM when RW access to root partition by fsck spoils VFS geom there, which has it opened RO at the same time. Seems spoiling concept needs some rework. Modified: head/sys/geom/geom_vfs.c Modified: head/sys/geom/geom_vfs.c ============================================================================== --- head/sys/geom/geom_vfs.c Sun Jul 29 18:52:18 2012 (r238891) +++ head/sys/geom/geom_vfs.c Sun Jul 29 20:04:09 2012 (r238892) @@ -65,13 +65,11 @@ static struct buf_ops __g_vfs_bufops = { struct buf_ops *g_vfs_bufops = &__g_vfs_bufops; static g_orphan_t g_vfs_orphan; -static g_spoiled_t g_vfs_spoiled; static struct g_class g_vfs_class = { .name = "VFS", .version = G_VERSION, .orphan = g_vfs_orphan, - .spoiled = g_vfs_spoiled, }; DECLARE_GEOM_CLASS(g_vfs_class, g_vfs); @@ -217,35 +215,8 @@ g_vfs_orphan(struct g_consumer *cp) if (sc == NULL) return; mtx_lock(&sc->sc_mtx); - destroy = (sc->sc_active == 0 && sc->sc_orphaned == 0); - sc->sc_orphaned = 1; - mtx_unlock(&sc->sc_mtx); - if (destroy) - g_vfs_destroy(cp, 0); - - /* - * Do not destroy the geom. Filesystem will do that during unmount. - */ -} - -static void -g_vfs_spoiled(struct g_consumer *cp) -{ - struct g_geom *gp; - struct g_vfs_softc *sc; - int destroy; - - g_topology_assert(); - - gp = cp->geom; - g_trace(G_T_TOPOLOGY, "g_vfs_spoiled(%p(%s))", cp, gp->name); - cp->flags |= G_CF_ORPHAN; - sc = gp->softc; - if (sc == NULL) - return; - mtx_lock(&sc->sc_mtx); - destroy = (sc->sc_active == 0 && sc->sc_orphaned == 0); sc->sc_orphaned = 1; + destroy = (sc->sc_active == 0); mtx_unlock(&sc->sc_mtx); if (destroy) g_vfs_destroy(cp, 0);