From owner-freebsd-fs@FreeBSD.ORG Fri Jan 16 11:10:29 2015 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE30149A for ; Fri, 16 Jan 2015 11:10:28 +0000 (UTC) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82218FA4 for ; Fri, 16 Jan 2015 11:10:27 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id a1so19905170wgh.9 for ; Fri, 16 Jan 2015 03:10:25 -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=oUB3Jiz8siXihIiBwAQ6XMuBCcK6H3VAYdgeFExaGFY=; b=PAP28EQtsYPBZtocn8F0HMOtUqLiG4BxIlPjhGwA86Bi8Qq1oGC8rLd9RA0V+AE6bJ bjRIdyNdOoqlIXNQyk4Om1/qNtTcya/sSeXzKZJpprjiS03gAlnfOfo2VVV32IIIOvho /OJu6k+b9YeeHOXw6Z6efQib9cvTK8WGKgKKrKWFpp4NsT1a6piY3gfZsSaAX8hMyMym Gx72quk3mR9ms9hQgY6523f9/QRAM+LfV6PM2fdcyKlYJ21mAllfiO60ZqGwvt9L38iD +L2tOPp75h5+nGVUzaAvIyvREYxWAXjvt/Q0yfYcM+w5GbHF7/8CL6AulWirINyud2HD fWhg== X-Gm-Message-State: ALoCoQm0iSlVmE3KGYKMdDMv2yNuRvD/2hoC39hetRh3I3pa6oFXiWVn953F8lmg+S/qpkQoERxG X-Received: by 10.194.57.84 with SMTP id g20mr28100938wjq.122.1421405164184; Fri, 16 Jan 2015 02:46:04 -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 fo2sm2472454wib.10.2015.01.16.02.46.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jan 2015 02:46:03 -0800 (PST) Message-ID: <54B8EBE4.1090804@multiplay.co.uk> Date: Fri, 16 Jan 2015 10:45:56 +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 11:10:29 -0000 Thanks again, committed as: https://svnweb.freebsd.org/changeset/base/277239 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"