Changeset e0622a6 in mainline


Ignore:
Timestamp:
2025-06-10T01:23:06Z (11 days ago)
Author:
Miroslav Cimerman <mc@…>
Children:
a62079d
Parents:
13ada52
Message:

hr: raid1.c: increment meta counter on first write

File:
1 edited

Legend:

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

    r13ada52 re0622a6  
    153153
    154154        bool exp = true;
    155 
    156155        if (!atomic_compare_exchange_strong(&vol->state_dirty, &exp, false))
    157156                return;
     
    330329                return EIO;
    331330
    332         if (!vol->data_dirty && type == HR_BD_WRITE) {
     331        /* increment metadata counter only on first write */
     332        bool exp = false;
     333        if (type == HR_BD_WRITE &&
     334            atomic_compare_exchange_strong(&vol->data_dirty, &exp, true)) {
    333335                vol->meta_ops->inc_counter(vol);
    334                 vol->data_dirty = true;
     336                vol->meta_ops->save(vol, WITH_STATE_CALLBACK);
    335337        }
    336338
     
    497499        fibril_rwlock_read_lock(&vol->extents_lock);
    498500
     501        /* increment metadata counter only on first write */
     502        bool exp = false;
     503        if (atomic_compare_exchange_strong(&vol->data_dirty, &exp, true)) {
     504                vol->meta_ops->inc_counter(vol);
     505                vol->meta_ops->save(vol, WITH_STATE_CALLBACK);
     506        }
     507
    499508        hr_range_lock_t *rl = NULL;
    500509
Note: See TracChangeset for help on using the changeset viewer.