diff options
author | Ameer Hamza <[email protected]> | 2023-04-19 21:04:32 +0500 |
---|---|---|
committer | GitHub <[email protected]> | 2023-04-19 09:04:32 -0700 |
commit | 719534ca8e8d39e94aef35d753c1c41179791ef5 (patch) | |
tree | 85226d9b3fc2bd3f6a2a26621f40b2fbd266a763 /include | |
parent | 3d37e7e5f540f513ab1d8fa61d9208c43b889401 (diff) |
Fix "Detach spare vdev in case if resilvering does not happen"
Spare vdev should detach from the pool when a disk is reinserted.
However, spare detachment depends on the completion of resilvering,
and if resilver does not schedule, the spare vdev keeps attached to
the pool until the next resilvering. When a zfs pool contains
several disks (25+ mirror), resilvering does not always happen when
a disk is reinserted. In this patch, spare vdev is manually detached
from the pool when resilvering does not occur and it has been tested
on both Linux and FreeBSD.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Ameer Hamza <[email protected]>
Closes #14722
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/spa.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sys/spa.h b/include/sys/spa.h index 79c46aa07..a1c102020 100644 --- a/include/sys/spa.h +++ b/include/sys/spa.h @@ -787,6 +787,7 @@ extern int bpobj_enqueue_free_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx); #define SPA_ASYNC_L2CACHE_REBUILD 0x800 #define SPA_ASYNC_L2CACHE_TRIM 0x1000 #define SPA_ASYNC_REBUILD_DONE 0x2000 +#define SPA_ASYNC_DETACH_SPARE 0x4000 /* device manipulation */ extern int spa_vdev_add(spa_t *spa, nvlist_t *nvroot); |