prashks commented on this pull request.
> + * vdevs, we can not add redundant toplevels. This ensures that
+ * we do not rely on resilver, which does not properly handle
+ * indirect vdevs.
+ */
+ if (spa->spa_vdev_removal != NULL ||
+ spa->spa_removing_phys.sr_prev_indirect_vdev != -1) {
+ for (int c = 0; c < vd->vdev_children; c++) {
+ if (spa->spa_vdev_removal != NULL &&
+ vd->vdev_child[c]->vdev_ashift !=
+ spa->spa_vdev_removal->svr_vdev->vdev_ashift) {
+ return (spa_vdev_exit(spa, vd, txg, EINVAL));
+ }
+ /* Fail if its raidz */
+ if (vd->vdev_ops == &vdev_raidz_ops) {
+ return (spa_vdev_exit(spa, vd, txg, EINVAL));
+ }
Yes, i have fixed this already and it passes the zfs test, below is the change
set that addresses this -
```
diff --git a/usr/src/uts/common/fs/zfs/spa.c b/usr/src/uts/common/fs/zfs/spa.c
index 3c0ef4c..6b35858 100644
--- a/usr/src/uts/common/fs/zfs/spa.c
+++ b/usr/src/uts/common/fs/zfs/spa.c
@@ -5527,29 +5527,31 @@ spa_vdev_add(spa_t *spa, nvlist_t *nvroot)
* If we are in the middle of a device removal, we can only add
* devices which match the existing devices in the pool.
* If we are in the middle of a removal, or have some indirect
- * vdevs, we can not add redundant toplevels. This ensures that
+ * vdevs, we can not add raidz toplevels. This ensures that
* we do not rely on resilver, which does not properly handle
* indirect vdevs.
*/
if (spa->spa_vdev_removal != NULL ||
spa->spa_removing_phys.sr_prev_indirect_vdev != -1) {
for (int c = 0; c < vd->vdev_children; c++) {
+ tvd = vd->vdev_child[c];
if (spa->spa_vdev_removal != NULL &&
- vd->vdev_child[c]->vdev_ashift !=
+ tvd->vdev_ashift !=
spa->spa_vdev_removal->svr_vdev->vdev_ashift) {
return (spa_vdev_exit(spa, vd, txg, EINVAL));
}
- /* Fail if its raidz */
- if (vd->vdev_ops == &vdev_raidz_ops) {
+ /* Fail if top level vdev is raidz */
+ if (tvd->vdev_ops == &vdev_raidz_ops) {
return (spa_vdev_exit(spa, vd, txg, EINVAL));
}
/*
- * Need the mirror to be mirror of leaf vdevs only
+ * Need the top level mirror to be
+ * a mirror of leaf vdevs only
*/
- if (vd->vdev_ops == &vdev_mirror_ops) {
+ if (tvd->vdev_ops == &vdev_mirror_ops) {
for (uint64_t cid = 0;
- cid < vd->vdev_children; cid++) {
- vdev_t *cvd = vd->vdev_child[cid];
+ cid < tvd->vdev_children; cid++) {
+ vdev_t *cvd = tvd->vdev_child[cid];
if (!cvd->vdev_ops->vdev_op_leaf) {
return (spa_vdev_exit(spa, vd,
txg, EINVAL));
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/482#discussion_r154517452
------------------------------------------
openzfs-developer
Archives:
https://openzfs.topicbox.com/groups/developer/discussions/Teafc5ffabd7f916f-Ma439a71ebd865d4afd11ff55
Powered by Topicbox: https://topicbox.com