3681 spa_async_remove(spa_t *spa, vdev_t *vd) |
3681 spa_async_remove(spa_t *spa, vdev_t *vd) |
3682 { |
3682 { |
3683 if (vd->vdev_remove_wanted) { |
3683 if (vd->vdev_remove_wanted) { |
3684 vd->vdev_remove_wanted = 0; |
3684 vd->vdev_remove_wanted = 0; |
3685 vdev_set_state(vd, B_FALSE, VDEV_STATE_REMOVED, VDEV_AUX_NONE); |
3685 vdev_set_state(vd, B_FALSE, VDEV_STATE_REMOVED, VDEV_AUX_NONE); |
3686 vdev_clear(spa, vd); |
3686 |
|
3687 /* |
|
3688 * We want to clear the stats, but we don't want to do a full |
|
3689 * vdev_clear() as that will cause us to throw away |
|
3690 * degraded/faulted state as well as attempt to reopen the |
|
3691 * device, all of which is a waste. |
|
3692 */ |
|
3693 vd->vdev_stat.vs_read_errors = 0; |
|
3694 vd->vdev_stat.vs_write_errors = 0; |
|
3695 vd->vdev_stat.vs_checksum_errors = 0; |
|
3696 |
3687 vdev_state_dirty(vd->vdev_top); |
3697 vdev_state_dirty(vd->vdev_top); |
3688 } |
3698 } |
3689 |
3699 |
3690 for (int c = 0; c < vd->vdev_children; c++) |
3700 for (int c = 0; c < vd->vdev_children; c++) |
3691 spa_async_remove(spa, vd->vdev_child[c]); |
3701 spa_async_remove(spa, vd->vdev_child[c]); |