aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/zfs/vdev_label.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c
index 7fab7d0d7..1c502b9e0 100644
--- a/module/zfs/vdev_label.c
+++ b/module/zfs/vdev_label.c
@@ -613,7 +613,8 @@ vdev_config_generate(spa_t *spa, vdev_t *vd, boolean_t getstats,
* as a single mapping.
*/
for (int i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i++) {
- if (1ULL << (i + 1) < vdev_removal_max_span) {
+ if (i + 1 < highbit64(vdev_removal_max_span)
+ - 1) {
to_alloc +=
vd->vdev_mg->mg_histogram[i] <<
(i + 1);