From owner-freebsd-fs@FreeBSD.ORG Thu Aug 5 12:00:23 2010 Return-Path: Delivered-To: freebsd-fs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3AE110656AB for ; Thu, 5 Aug 2010 12:00:23 +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 D18398FC23 for ; Thu, 5 Aug 2010 12:00:23 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o75C0N8t028008 for ; Thu, 5 Aug 2010 12:00:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o75C0NFF028007; Thu, 5 Aug 2010 12:00:23 GMT (envelope-from gnats) Date: Thu, 5 Aug 2010 12:00:23 GMT Message-Id: <201008051200.o75C0NFF028007@freefall.freebsd.org> To: freebsd-fs@FreeBSD.org From: Martin Matuska Cc: Subject: Re: kern/148655: [zfs] Booting from a degraded raidz no longer works in 8-STABLE [regression] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Martin Matuska List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2010 12:00:24 -0000 The following reply was made to PR kern/148655; it has been noted by GNATS. From: Martin Matuska To: bug-followup@FreeBSD.org, Andriy Gapon Cc: Subject: Re: kern/148655: [zfs] Booting from a degraded raidz no longer works in 8-STABLE [regression] Date: Thu, 05 Aug 2010 13:53:44 +0200 So I have done more code reading and debugging with mfsBSD in virtualbox and I came to the following conclusion: sys/boot/zfs/zfsimpl.c reads vdev information from the pool but there is no check if these vdevs do exist on physical devices. In other words, if the pool has last seen its vdevs as HEALTHY, gptzfsboot assumes all of them are available. So this way e.g. in case of a mirror, the vdev_mirror_read() tries to read from the first "healthy" vdev in its list. If the first vdev is the missing vdev (e.g. a disconnected or failed drive), it just cannot read from it so you are unable to boot. In my test setup, vdev_mirror_read() reported two healty kids and tried to read from the non-existing vdev. I think in the boot case, we should first scan for all physically available vdevs, then scan for children from their configuration. All child vdevs that cannot be physically opened (do not have a representation from the previous scan) should be set to state VDEV_STATE_CANT_OPEN and not assumed as VDEV_STATE_HEALTHY.