[Devel] [RFC PATCH vz9 v6 23/62] dm-ploop: make new allocations immediately visible in BAT
Alexander Atanasov
alexander.atanasov at virtuozzo.com
Mon Jan 20 21:06:26 MSK 2025
On 20.01.25 10:49, Pavel Tikhomirov wrote:
>
>
> On 12/6/24 05:55, Alexander Atanasov wrote:
>> @@ -1120,6 +1117,8 @@ static int ploop_alloc_cluster(struct ploop
>> *ploop, struct ploop_index_wb *piwb,
>> to = piwb->kmpage;
>> WRITE_ONCE(to[clu], *dst_clu);
>> + to = piwb->md->kmpage;
>> + WRITE_ONCE(to[clu], *dst_clu);
>
> Probably we also need to set bat_levels here too.
yes, under lock too. a rule - if updateing both do it under lock.
spin_lock_irq(&piwb->md->md_lock);
WRITE_ONCE(to[clu], *dst_clu);
WRITE_ONCE(piwb->md->bat_levels[clu], ploop_top_level(ploop));
spin_unlock_irq(&piwb->md->md_lock);
>
>> out:
>> return ret;
>> }
>
--
Regards,
Alexander Atanasov
More information about the Devel
mailing list