Date: Thu, 22 Feb 2018 01:17:32 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329778 - vendor/illumos/dist/cmd/zpool Message-ID: <201802220117.w1M1HWb1033009@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Feb 22 01:17:32 2018 New Revision: 329778 URL: https://svnweb.freebsd.org/changeset/base/329778 Log: 8941 zpool add: assertion failed in get_replication() with nested interior VDEVs illumos/illumos-gate@ac0215f4d618163d117a40fbf77a3f944852cb7b When replacing a faulted device which was previously handled by a spare multiple levels of nested interior VDEVs will be present in the pool configuration: get_replication() needs to handle this situation gracefully to let zpool add new devices to the pool Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com> Author: loli10K <ezomori.nozomu@gmail.com> Modified: vendor/illumos/dist/cmd/zpool/zpool_vdev.c Modified: vendor/illumos/dist/cmd/zpool/zpool_vdev.c ============================================================================== --- vendor/illumos/dist/cmd/zpool/zpool_vdev.c Thu Feb 22 01:00:46 2018 (r329777) +++ vendor/illumos/dist/cmd/zpool/zpool_vdev.c Thu Feb 22 01:17:32 2018 (r329778) @@ -628,9 +628,11 @@ get_replication(nvlist_t *nvroot, boolean_t fatal) /* * If this is a replacing or spare vdev, then - * get the real first child of the vdev. + * get the real first child of the vdev: do this + * in a loop because replacing and spare vdevs + * can be nested. */ - if (strcmp(childtype, + while (strcmp(childtype, VDEV_TYPE_REPLACING) == 0 || strcmp(childtype, VDEV_TYPE_SPARE) == 0) { nvlist_t **rchild;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802220117.w1M1HWb1033009>