aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/spa_config.c
diff options
context:
space:
mode:
authorAmeer Hamza <[email protected]>2023-01-10 01:43:03 +0500
committerGitHub <[email protected]>2023-01-09 12:43:03 -0800
commit5091867ee66489012473626c5f58f3c4d66ea5f0 (patch)
tree2d62f29419646c9ec3a28d9411f4950d8f8075a3 /module/zfs/spa_config.c
parent289f7e6adb58336281e87bffe853b280fc8ee498 (diff)
zed: add hotplug support for spare vdevs
This commit supports for spare vdev hotplug. The spare vdev associated with all the pools will be marked as "Removed" when the driveĀ is physically detached and will become "Available" when the drive is reattached. Currently, the spare vdev status does not change on the drive removal and the same is the case with reattachment. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ameer Hamza <[email protected]> Closes #14295
Diffstat (limited to 'module/zfs/spa_config.c')
-rw-r--r--module/zfs/spa_config.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c
index 5165c3704..bf4d1e210 100644
--- a/module/zfs/spa_config.c
+++ b/module/zfs/spa_config.c
@@ -356,6 +356,8 @@ spa_write_cachefile(spa_t *target, boolean_t removing, boolean_t postsysevent,
vdev_post_kobj_evt(target->spa_root_vdev);
for (int i = 0; i < target->spa_l2cache.sav_count; i++)
vdev_post_kobj_evt(target->spa_l2cache.sav_vdevs[i]);
+ for (int i = 0; i < target->spa_spares.sav_count; i++)
+ vdev_post_kobj_evt(target->spa_spares.sav_vdevs[i]);
}
}