HomeFreeBSD

Fix "Detach spare vdev in case if resilvering does not happen"

Description

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 <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #14722

Details

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGa68dfdb88c88: Fix "Detach spare vdev in case if resilvering does not happen" (authored by Ameer Hamza <106930537+ixhamza@users.noreply.github.com>).Apr 24 2023, 4:56 PM