mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Skip spurious resilver IO on raidz vdev
On a raidz vdev, a block that does not span all child vdevs, excluding its skip sectors if any, may not be affected by a child vdev outage or failure. In such cases, the block does not need to be resilvered. However, current resilver algorithm simply resilvers all blocks on a degraded raidz vdev. Such spurious IO is not only wasteful, but also adds the risk of overwriting good data. This patch eliminates such spurious IOs. Reviewed-by: Gvozden Neskovic <neskovic@gmail.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Signed-off-by: Isaac Huang <he.huang@intel.com> Closes #5316
This commit is contained in:
committed by
Brian Behlendorf
parent
8c54ddd33a
commit
3d6da72d18
@@ -1819,6 +1819,21 @@ vdev_dtl_empty(vdev_t *vd, vdev_dtl_type_t t)
|
||||
return (empty);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns B_TRUE if vdev determines offset needs to be resilvered.
|
||||
*/
|
||||
boolean_t
|
||||
vdev_dtl_need_resilver(vdev_t *vd, uint64_t offset, size_t psize)
|
||||
{
|
||||
ASSERT(vd != vd->vdev_spa->spa_root_vdev);
|
||||
|
||||
if (vd->vdev_ops->vdev_op_need_resilver == NULL ||
|
||||
vd->vdev_ops->vdev_op_leaf)
|
||||
return (B_TRUE);
|
||||
|
||||
return (vd->vdev_ops->vdev_op_need_resilver(vd, offset, psize));
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the lowest txg in the DTL range.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user