@@ -1715,8 +1715,7 @@ vdev_draid_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize,
17151715 * the same number of slices.
17161716 */
17171717 if (vdc -> vdc_width > vdc -> vdc_children ) {
1718- uint64_t slicesz = VDEV_DRAID_ROWHEIGHT *
1719- (vdc -> vdc_groupwidth * vdc -> vdc_ngroups );
1718+ uint64_t slicesz = vdc -> vdc_devslicesz * vdc -> vdc_ndisks ;
17201719 uint64_t n = (vdc -> vdc_width / vdc -> vdc_children );
17211720 * asize = (* asize / slicesz ) * slicesz * n ;
17221721 * max_asize = (* max_asize / slicesz ) * slicesz * n ;
@@ -1830,7 +1829,7 @@ vdev_draid_spare_create(nvlist_t *nvroot, vdev_t *vd, uint64_t *ndraidp,
18301829
18311830 if (draid_nspares == 0 ) {
18321831 * ndraidp = ndraid ;
1833- * nfgroupp = nfgroup ++ ;
1832+ * nfgroupp = nfgroup ;
18341833 return (0 );
18351834 }
18361835
@@ -2606,15 +2605,15 @@ vdev_draid_spare_get_child(vdev_t *vd, uint64_t physical_offset)
26062605 uint64_t perm = (physical_offset / vdc -> vdc_devslicesz ) * n ;
26072606
26082607 /*
2609- * Adjust iter by vds_spare_id so that it points to the correct slice
2610- * in the big width row.
2608+ * Adjust permutation so that it points to the correct slice in the
2609+ * big width row.
26112610 */
26122611 perm += vds -> vds_spare_id / vdc -> vdc_nspares ;
26132612
26142613 vdev_draid_get_perm (vdc , perm , & base , & iter );
26152614
26162615 uint64_t cid = vdev_draid_permute_id (vdc , base , iter ,
2617- (vdc -> vdc_children - 1 ) - vds -> vds_spare_id % vdc -> vdc_nspares );
2616+ (vdc -> vdc_children - 1 ) - ( vds -> vds_spare_id % vdc -> vdc_nspares ) );
26182617 vdev_t * cvd = tvd -> vdev_child [cid ];
26192618
26202619 if (cvd -> vdev_ops == & vdev_draid_spare_ops )
0 commit comments