Date: Fri, 16 Jan 2015 10:45:56 +0000 From: Steven Hartland <killing@multiplay.co.uk> To: freebsd-fs@freebsd.org Subject: Re: bugfix: zpool online might fail when disk suffix start with "c[0-9]" Message-ID: <54B8EBE4.1090804@multiplay.co.uk> In-Reply-To: <CAGRNztAedmw6_CHvWKfWu0B0DeSRS_j5te9ZCJ=z_cHEatC-cw@mail.gmail.com> References: <CAGRNztAedmw6_CHvWKfWu0B0DeSRS_j5te9ZCJ=z_cHEatC-cw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54B8EBE4.1090804>