From owner-freebsd-bugs@FreeBSD.ORG Tue Dec 9 23:10:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 276DF1065673 for ; Tue, 9 Dec 2008 23:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 026F38FC1E for ; Tue, 9 Dec 2008 23:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9NA1Wn095340 for ; Tue, 9 Dec 2008 23:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mB9NA1bP095339; Tue, 9 Dec 2008 23:10:01 GMT (envelope-from gnats) Resent-Date: Tue, 9 Dec 2008 23:10:01 GMT Resent-Message-Id: <200812092310.mB9NA1bP095339@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Paul Wootton Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17152106564A for ; Tue, 9 Dec 2008 23:06:41 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 040E98FC12 for ; Tue, 9 Dec 2008 23:06:41 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mB9N6eQE094979 for ; Tue, 9 Dec 2008 23:06:40 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id mB9N6eqX094978; Tue, 9 Dec 2008 23:06:40 GMT (envelope-from nobody) Message-Id: <200812092306.mB9N6eqX094978@www.freebsd.org> Date: Tue, 9 Dec 2008 23:06:40 GMT From: Paul Wootton To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/129539: ZFS Boot from single drive or mirror with raidz data pack X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Dec 2008 23:10:02 -0000 >Number: 129539 >Category: misc >Synopsis: ZFS Boot from single drive or mirror with raidz data pack >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Dec 09 23:10:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Paul Wootton >Release: FreeBSD 8.0 >Organization: >Environment: FreeBSD wasp.caspersworld.co.uk 8.0-CURRENT FreeBSD 8.0-CURRENT #1: Sat Dec 6 22:49:23 UTC 2008 paul@wasp.caspersworld.co.uk:/usr/obj/usr/src/sys/WASP amd64 >Description: When booting from a single ZFS disk or mirror pack with a raidz pack also present, the system just cyclic boots with the following error ZFS: can only boot from disk or mirror vdevs ZFS: inconsistent nvlist contents This is caused because we forgot to check the return code of vdev_init_from_nvlist(vdevs, &top_vdev) from with the vdev_probe() function in /usr/src/sys/boot/zfs/zfsimple.c on line 726 >How-To-Repeat: Set up bootable ZFS single drive or mirror pack and then introduce a raidz pack as well >Fix: Check the return code of vdev_init_from_nvlist(vdevs, &top_vdev) from with the vdev_probe() function in /usr/src/sys/boot/zfs/zfsimple.c on line 726 Patch attached with submission follows: *** zfsimpl.c Wed Nov 19 16:59:19 2008 --- zfsimpl.c.fix Tue Dec 9 22:48:36 2008 *************** *** 721,731 **** if (nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, 0, &vdevs)) { return (EIO); } ! vdev_init_from_nvlist(vdevs, &top_vdev); /* * Add the toplevel vdev to the pool if its not already there. */ STAILQ_FOREACH(pool_vdev, &spa->spa_vdevs, v_childlink) --- 721,733 ---- if (nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, 0, &vdevs)) { return (EIO); } ! int initRetVal = vdev_init_from_nvlist(vdevs, &top_vdev); ! if(initRetVal) ! return initRetVal; /* * Add the toplevel vdev to the pool if its not already there. */ STAILQ_FOREACH(pool_vdev, &spa->spa_vdevs, v_childlink) >Release-Note: >Audit-Trail: >Unformatted: