From owner-svn-src-head@FreeBSD.ORG Tue Dec 16 20:59:27 2008 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 CF6651065670; Tue, 16 Dec 2008 20:59:27 +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 C24C28FC19; Tue, 16 Dec 2008 20:59:27 +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 mBGKxRlq047537; Tue, 16 Dec 2008 20:59:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBGKxRHE047536; Tue, 16 Dec 2008 20:59:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200812162059.mBGKxRHE047536@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 16 Dec 2008 20:59:27 +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: r186193 - head/sys/dev/md 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: Tue, 16 Dec 2008 20:59:27 -0000 Author: trasz Date: Tue Dec 16 20:59:27 2008 New Revision: 186193 URL: http://svn.freebsd.org/changeset/base/186193 Log: Fix forced mdconfig -du. E.g. the following would previously result in panic: mdconfig -af blah.img -o force mount /dev/md0 /mnt mdconfig -du 0 Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Tue Dec 16 20:48:38 2008 (r186192) +++ head/sys/dev/md/md.c Tue Dec 16 20:59:27 2008 (r186193) @@ -374,8 +374,11 @@ g_md_access(struct g_provider *pp, int r struct md_s *sc; sc = pp->geom->softc; - if (sc == NULL) + if (sc == NULL) { + if (r <= 0 && w <= 0 && e <= 0) + return (0); return (ENXIO); + } r += pp->acr; w += pp->acw; e += pp->ace;