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

Provenance
Ameer Hamza <106930537+ixhamza@users.noreply.github.com>Authored on Apr 19 2023, 4:04 PM
GitHub <noreply@github.com>Committed on Apr 19 2023, 4:04 PM
Parents
rG3d37e7e5f540: zfsprops.7: update mandlock
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG719534ca8e8d: Fix "Detach spare vdev in case if resilvering does not happen" (authored by Ameer Hamza <106930537+ixhamza@users.noreply.github.com>).Apr 19 2023, 4:04 PM