130 * out again. We'll pick up the fact that a resilver is happening |
130 * out again. We'll pick up the fact that a resilver is happening |
131 * later. |
131 * later. |
132 */ |
132 */ |
133 verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE, &type) == 0); |
133 verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE, &type) == 0); |
134 if (strcmp(type, VDEV_TYPE_REPLACING) == 0) |
134 if (strcmp(type, VDEV_TYPE_REPLACING) == 0) |
135 return (FALSE); |
135 return (B_FALSE); |
136 |
136 |
137 if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_CHILDREN, &child, |
137 if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_CHILDREN, &child, |
138 &children) == 0) { |
138 &children) == 0) { |
139 for (c = 0; c < children; c++) |
139 for (c = 0; c < children; c++) |
140 if (find_vdev_problem(child[c], func)) |
140 if (find_vdev_problem(child[c], func)) |
141 return (TRUE); |
141 return (B_TRUE); |
142 } else { |
142 } else { |
143 verify(nvlist_lookup_uint64_array(vdev, ZPOOL_CONFIG_STATS, |
143 verify(nvlist_lookup_uint64_array(vdev, ZPOOL_CONFIG_STATS, |
144 (uint64_t **)&vs, &c) == 0); |
144 (uint64_t **)&vs, &c) == 0); |
145 |
145 |
146 if (func(vs->vs_state, vs->vs_aux, |
146 if (func(vs->vs_state, vs->vs_aux, |
147 vs->vs_read_errors + |
147 vs->vs_read_errors + |
148 vs->vs_write_errors + |
148 vs->vs_write_errors + |
149 vs->vs_checksum_errors)) |
149 vs->vs_checksum_errors)) |
150 return (TRUE); |
150 return (B_TRUE); |
151 } |
151 } |
152 |
152 |
153 return (FALSE); |
153 return (B_FALSE); |
154 } |
154 } |
155 |
155 |
156 /* |
156 /* |
157 * Active pool health status. |
157 * Active pool health status. |
158 * |
158 * |
169 * |
169 * |
170 * There can obviously be multiple errors within a single pool, so this routine |
170 * There can obviously be multiple errors within a single pool, so this routine |
171 * only picks the most damaging of all the current errors to report. |
171 * only picks the most damaging of all the current errors to report. |
172 */ |
172 */ |
173 static zpool_status_t |
173 static zpool_status_t |
174 check_status(nvlist_t *config, int isimport) |
174 check_status(nvlist_t *config, boolean_t isimport) |
175 { |
175 { |
176 nvlist_t *nvroot; |
176 nvlist_t *nvroot; |
177 vdev_stat_t *vs; |
177 vdev_stat_t *vs; |
178 uint_t vsc; |
178 uint_t vsc; |
179 uint64_t nerr; |
179 uint64_t nerr; |