summaryrefslogtreecommitdiffstats
path: root/module/zfs/spa_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs/spa_misc.c')
-rw-r--r--module/zfs/spa_misc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c
index 1640dcedd..540fd1077 100644
--- a/module/zfs/spa_misc.c
+++ b/module/zfs/spa_misc.c
@@ -1807,10 +1807,11 @@ spa_update_dspace(spa_t *spa)
ddt_get_dedup_dspace(spa);
if (spa->spa_vdev_removal != NULL) {
/*
- * We can't allocate from the removing device, so
- * subtract its size. This prevents the DMU/DSL from
- * filling up the (now smaller) pool while we are in the
- * middle of removing the device.
+ * We can't allocate from the removing device, so subtract
+ * its size if it was included in dspace (i.e. if this is a
+ * normal-class vdev, not special/dedup). This prevents the
+ * DMU/DSL from filling up the (now smaller) pool while we
+ * are in the middle of removing the device.
*
* Note that the DMU/DSL doesn't actually know or care
* how much space is allocated (it does its own tracking
@@ -1822,8 +1823,10 @@ spa_update_dspace(spa_t *spa)
spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
vdev_t *vd =
vdev_lookup_top(spa, spa->spa_vdev_removal->svr_vdev_id);
- spa->spa_dspace -= spa_deflate(spa) ?
- vd->vdev_stat.vs_dspace : vd->vdev_stat.vs_space;
+ if (vd->vdev_mg->mg_class == spa_normal_class(spa)) {
+ spa->spa_dspace -= spa_deflate(spa) ?
+ vd->vdev_stat.vs_dspace : vd->vdev_stat.vs_space;
+ }
spa_config_exit(spa, SCL_VDEV, FTAG);
}
}