* Determine if any portion of the provided block resides on a child vdev * with a dirty DTL and therefore needs to be resilvered. */
| 1959 | * with a dirty DTL and therefore needs to be resilvered. |
| 1960 | */ |
| 1961 | static boolean_t |
| 1962 | vdev_draid_need_resilver(vdev_t *vd, const dva_t *dva, size_t psize, |
| 1963 | uint64_t phys_birth) |
| 1964 | { |
| 1965 | uint64_t offset = DVA_GET_OFFSET(dva); |
| 1966 | uint64_t asize = vdev_draid_asize(vd, psize); |
| 1967 | |
| 1968 | if (phys_birth == TXG_UNKNOWN) { |
| 1969 | /* |
| 1970 | * Sequential resilver. There is no meaningful phys_birth |
| 1971 | * for this block, we can only determine if block resides |
| 1972 | * in a degraded group in which case it must be resilvered. |
| 1973 | */ |
| 1974 | ASSERT3U(vdev_draid_offset_to_group(vd, offset), ==, |
| 1975 | vdev_draid_offset_to_group(vd, offset + asize - 1)); |
| 1976 | |
| 1977 | return (vdev_draid_group_degraded(vd, offset)); |
| 1978 | } else { |
| 1979 | /* |
| 1980 | * Healing resilver. TXGs not in DTL_PARTIAL are intact, |
| 1981 | * as are blocks in non-degraded groups. |
| 1982 | */ |
| 1983 | if (!vdev_dtl_contains(vd, DTL_PARTIAL, phys_birth, 1)) |
| 1984 | return (B_FALSE); |
| 1985 | |
| 1986 | if (vdev_draid_group_missing(vd, offset, phys_birth, 1)) |
| 1987 | return (B_TRUE); |
| 1988 | |
| 1989 | /* The block may span groups in which case check both. */ |
| 1990 | if (vdev_draid_offset_to_group(vd, offset) != |
| 1991 | vdev_draid_offset_to_group(vd, offset + asize - 1)) { |
| 1992 | if (vdev_draid_group_missing(vd, |
| 1993 | offset + asize, phys_birth, 1)) |
| 1994 | return (B_TRUE); |
| 1995 | } |
| 1996 | |
| 1997 | return (B_FALSE); |
| 1998 | } |
| 1999 | } |
| 2000 | |
| 2001 | static boolean_t |
| 2002 | vdev_draid_rebuilding(vdev_t *vd) |
nothing calls this directly
no test coverage detected