Changeset 13ada52 in mainline


Ignore:
Timestamp:
2025-06-10T00:30:43Z (9 days ago)
Author:
Miroslav Cimerman <mc@…>
Children:
8332317
Parents:
6791fbf
Message:

hr: make failing an extent erase the superblock

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/hr/hr.c

    r6791fbf r13ada52  
    342342
    343343        service_id_t svc_id;
    344         size_t fail_extent;
     344        size_t extent_idx_to_fail;
    345345        hr_volume_t *vol;
    346346
    347347        svc_id = (service_id_t)ipc_get_arg1(icall);
    348         fail_extent = (size_t)ipc_get_arg2(icall);
     348        extent_idx_to_fail = (size_t)ipc_get_arg2(icall);
    349349
    350350        vol = hr_get_volume(svc_id);
     
    354354        }
    355355
     356        hr_extent_t *ext = &vol->extents[extent_idx_to_fail];
     357
    356358        fibril_rwlock_read_lock(&vol->extents_lock);
    357359        fibril_rwlock_write_lock(&vol->states_lock);
    358360
    359         switch (vol->extents[fail_extent].state) {
     361        switch (ext->state) {
    360362        case HR_EXT_NONE:
    361363        case HR_EXT_MISSING:
     
    366368                return;
    367369        default:
    368                 hr_update_ext_state(vol, fail_extent, HR_EXT_FAILED);
     370                hr_update_ext_state(vol, extent_idx_to_fail, HR_EXT_FAILED);
     371                (void)vol->meta_ops->erase_block(ext->svc_id);
    369372                hr_mark_vol_state_dirty(vol);
    370373        }
Note: See TracChangeset for help on using the changeset viewer.