From owner-freebsd-fs@FreeBSD.ORG Fri Jan 16 10:09:00 2015 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D79D127B for ; Fri, 16 Jan 2015 10:09:00 +0000 (UTC) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EA12999 for ; Fri, 16 Jan 2015 10:08:59 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id l15so2935205wiw.2 for ; Fri, 16 Jan 2015 02:08:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=iL1Mub2pSW/8ZyW+UKQ973eKd0WIwb1+PBDiU5r6rRw=; b=QgT6F5aaH/QP2igWZgQQMoNYy2LSmFFk+Y4k+enUHdqE5MUGTF1NhcGFNFyGDysebv 1u0MlxzkbTSh1C6NeuYH0EdZKrl5sN1skQlq9A/kzFeCdaT42wTKrZChHaZPisUlXhKW bkvkVW4iRuN/c4gJEGteCaELVvGD7RrlU/uAAu9RrfWrycIW/QiM6XHW12qvch/VlZ8X r7x0gbjy4lvO9+4mxRP8wOgqeMl5yh5FWWYAAhfLGSAdVd3BrP6VP5FqvBRurZl8/yjW M7kscKsqqwizwy8NT2CZpbI2LNWl6nn0G1wsluIa8RhdosZzY6u2DSqjmhub8VmqhURF mdtQ== X-Gm-Message-State: ALoCoQngoK1m826ClLyti5TOJ3Lxn/hIGvrAsAOoaJBxjRDwyqdNI/j57t/1BgpPcwDHasMGfriN X-Received: by 10.194.19.73 with SMTP id c9mr10277939wje.124.1421402937177; Fri, 16 Jan 2015 02:08:57 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id ep9sm2364860wid.3.2015.01.16.02.08.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jan 2015 02:08:56 -0800 (PST) Message-ID: <54B8E331.9000304@multiplay.co.uk> Date: Fri, 16 Jan 2015 10:08:49 +0000 From: Steven Hartland User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: freebsd-fs@freebsd.org Subject: Re: bugfix: zpool online might fail when disk suffix start with "c[0-9]" References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2015 10:09:01 -0000 Thanks Peter and good catch, I'll have a look at this shortly :) Regards Steve On 16/01/2015 03:52, Peter Xu wrote: > Hi, all, > > Found one bug for libzfs that some disk could not be onlined using its > physical path. I met the problem once when I try to online disk: > > gptid/c6cde092-504b-11e4-ba52-c45444453598 > > This is a partition of GPT disk, and zpool returned with the error that no > such device found. > > I tried online it using VDEV ID, and it worked. > > The problem is, libzfs hacked vdev_to_nvlist_iter() to take special care > for ZPOOL_CONFIG_PATH searches (also, it seems that vdev->wholedisk is used > for this matter). This should be for Solaris but not Freebsd. BSD should > not need these hacks at all. Fixing this bug by commenting out the hacking > code path. > > diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c > b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c > index df8317f..e16f5c6 100644 > --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c > +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c > @@ -1969,6 +1969,7 @@ vdev_to_nvlist_iter(nvlist_t *nv, nvlist_t *search, > boolean_t *avail_spare, > if (nvlist_lookup_string(nv, srchkey, &val) != 0) > break; > > +#ifdef sun > /* > * Search for the requested value. Special cases: > * > @@ -2018,6 +2019,9 @@ vdev_to_nvlist_iter(nvlist_t *nv, nvlist_t *search, > boolean_t *avail_spare, > break; > } > } else if (strcmp(srchkey, ZPOOL_CONFIG_TYPE) == 0 && val) { > +#else > + if (strcmp(srchkey, ZPOOL_CONFIG_TYPE) == 0 && val) { > +#endif > char *type, *idx, *end, *p; > uint64_t id, vdev_id; > > I am one of Freebsd user (also ZFS user). Just want to contribute something > back. Hope I am posting to the write place. > > Peter > _______________________________________________ > freebsd-fs@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"