Changeset d04a350 in mainline


Ignore:
Timestamp:
2025-06-30T11:09:46Z (3 weeks ago)
Author:
Miroslav Cimerman <mc@…>
Children:
dcdb990
Parents:
059885c
Message:

hr: metadata/gmirror: fix setting extent states

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/hr/metadata/foreign/geom/hr_g_mirror.c

    r059885c rd04a350  
    178178        memcpy(vol->in_mem_md, main_meta, sizeof(struct g_mirror_metadata));
    179179
    180         bool rebuild = false;
     180        bool rebuild_set = false;
    181181
    182182        uint8_t index = 0;
     
    192192
    193193                bool invalidate = false;
     194                bool rebuild_this_ext = false;
    194195
    195196                if (iter_meta->md_dflags & G_MIRROR_DISK_FLAG_DIRTY)
     
    200201                if (iter_meta->md_dflags & G_MIRROR_DISK_FLAG_SYNCHRONIZING &&
    201202                    !invalidate) {
    202                         if (rebuild) {
     203                        if (rebuild_set) {
    203204                                HR_DEBUG("only 1 rebuilt extent allowed");
    204205                                rc = EINVAL;
    205206                                goto error;
    206207                        }
    207                         rebuild = true;
     208                        rebuild_set = true;
     209                        rebuild_this_ext = true;
    208210                        vol->rebuild_blk = iter_meta->md_sync_offset;
    209211                }
    210212
    211                 if (!rebuild && !invalidate)
     213                if (!rebuild_this_ext && !invalidate)
    212214                        vol->extents[index].state = HR_EXT_ONLINE;
    213                 else if (rebuild && !invalidate)
     215                else if (rebuild_this_ext && !invalidate)
    214216                        vol->extents[index].state = HR_EXT_REBUILD;
    215217                else
Note: See TracChangeset for help on using the changeset viewer.