Date: Tue, 9 Dec 2008 23:06:40 GMT From: Paul Wootton <paul@fletchermoorland.co.uk> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/129539: ZFS Boot from single drive or mirror with raidz data pack Message-ID: <200812092306.mB9N6eqX094978@www.freebsd.org> Resent-Message-ID: <200812092310.mB9NA1bP095339@freefall.freebsd.org>
index | next in thread | raw e-mail
>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:
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812092306.mB9N6eqX094978>
