]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/spa.c
Fix "Detach spare vdev in case if resilvering does not happen"
authorAmeer Hamza <106930537+ixhamza@users.noreply.github.com>
Wed, 19 Apr 2023 16:04:32 +0000 (21:04 +0500)
committerGitHub <noreply@github.com>
Wed, 19 Apr 2023 16:04:32 +0000 (09:04 -0700)
commit719534ca8e8d39e94aef35d753c1c41179791ef5
tree85226d9b3fc2bd3f6a2a26621f40b2fbd266a763
parent3d37e7e5f540f513ab1d8fa61d9208c43b889401
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
include/sys/spa.h
module/zfs/spa.c
module/zfs/vdev.c