Changeset 059885c in mainline
- Timestamp:
- 2025-06-30T10:55:31Z (4 weeks ago)
- Children:
- d04a350
- Parents:
- 95ca19d
- Location:
- uspace/srv/bd/hr/metadata/foreign/softraid
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/hr/metadata/foreign/softraid/hr_softraid.c
r95ca19d r059885c 182 182 memcpy(vol->in_mem_md, main_meta, SR_META_SIZE * DEV_BSIZE); 183 183 184 bool rebuild = false;184 bool rebuild_set = false; 185 185 list_foreach(*list, link, struct dev_list_member, iter) { 186 186 struct sr_metadata *iter_meta = iter->md; … … 195 195 196 196 bool invalidate = false; 197 bool rebuild_this_ext = false; 197 198 198 199 if (iter_meta->ssd_meta_flags & SR_META_DIRTY) … … 202 203 203 204 if (mc->scm_status == BIOC_SDREBUILD && !invalidate) { 204 if (rebuild ) {205 if (rebuild_set) { 205 206 HR_DEBUG("only 1 rebuilt extent allowed"); 206 207 rc = EINVAL; 207 208 goto error; 208 209 } 209 rebuild = true; 210 rebuild_set = true; 211 rebuild_this_ext = true; 210 212 vol->rebuild_blk = iter_meta->ssd_rebuild; 211 213 } 212 214 213 if (!rebuild && !invalidate)215 if (!rebuild_this_ext && !invalidate) 214 216 vol->extents[index].state = HR_EXT_ONLINE; 215 else if (rebuild && !invalidate)217 else if (rebuild_this_ext && !invalidate) 216 218 vol->extents[index].state = HR_EXT_REBUILD; 217 219 else … … 297 299 fibril_mutex_lock(&vol->md_lock); 298 300 299 if (s == HR_EXT_REBUILD) { 300 md->ssd_rebuild = vol->rebuild_blk; 301 md->ssd_rebuild = vol->rebuild_blk; 302 md->ssdi.ssd_chunk_id = ext_idx; 303 304 if (s == HR_EXT_REBUILD) 301 305 mc->scm_status = BIOC_SDREBUILD; 302 } else { 303 md->ssd_rebuild = 0; 306 else 304 307 mc->scm_status = BIOC_SDONLINE; 305 }306 308 307 309 meta_softraid_encode(md, md_block); … … 355 357 { 356 358 uint8_t flags = 0; 359 360 flags |= HR_METADATA_ALLOW_REBUILD; 357 361 358 362 return flags; -
uspace/srv/bd/hr/metadata/foreign/softraid/softraid.c
r95ca19d r059885c 97 97 printf("\tssd_meta_flags 0x%" PRIx32 "\n", m->ssd_meta_flags); 98 98 printf("\tssd_ondisk %" PRId64 "\n", m->ssd_ondisk); 99 printf("\tssd_rebuild %" PRId64 "\n", m->ssd_rebuild); 99 100 100 101 mc = (struct sr_meta_chunk *)(m + 1);
Note:
See TracChangeset
for help on using the changeset viewer.