From owner-svn-src-all@FreeBSD.ORG Sun Jan 11 13:51:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C5481065670; Sun, 11 Jan 2009 13:51:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89F708FC1E; Sun, 11 Jan 2009 13:51:04 +0000 (UTC) (envelope-from trasz@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 n0BDp4JE029873; Sun, 11 Jan 2009 13:51:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0BDp427029872; Sun, 11 Jan 2009 13:51:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200901111351.n0BDp427029872@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 11 Jan 2009 13:51:04 +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: r187053 - head/sys/geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2009 13:51:05 -0000 Author: trasz Date: Sun Jan 11 13:51:04 2009 New Revision: 187053 URL: http://svn.freebsd.org/changeset/base/187053 Log: Prevent a panic that happens on SMP machines when removing a disk with many writes queued up. Reviewed by: phk, scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Modified: head/sys/geom/geom_vfs.c Modified: head/sys/geom/geom_vfs.c ============================================================================== --- head/sys/geom/geom_vfs.c Sun Jan 11 12:04:18 2009 (r187052) +++ head/sys/geom/geom_vfs.c Sun Jan 11 13:51:04 2009 (r187053) @@ -71,6 +71,16 @@ g_vfs_done(struct bio *bip) struct buf *bp; int vfslocked; + /* + * Provider ('bio_to') could have withered away sometime + * between incrementing the 'nend' in g_io_deliver() and now, + * making 'bio_to' a dangling pointer. We cannot do that + * in g_wither_geom(), as it would require going over + * the 'g_bio_run_up' list, resetting the pointer. + */ + if (bip->bio_from->provider == NULL) + bip->bio_to = NULL; + if (bip->bio_error) { printf("g_vfs_done():"); g_print_bio(bip); @@ -136,7 +146,7 @@ g_vfs_orphan(struct g_consumer *cp) g_detach(cp); /* - * Do not destroy the geom. Filesystem will do this during unmount. + * Do not destroy the geom. Filesystem will do that during unmount. */ }