Bug #52323
closed[pwl ssd] incorrect first_valid_entry calculation in retire_entries()
0%
Description
If we kill the running program which write data w/ pwl/ssd cache. It can't restart because read wrong . There are two reasons:
1:
2021-08-19T15:37:02.026+0800 7f812e5fc700 0 librbd::cache::pwl::ssd::WriteLog: 0x7f836c0151b0 schedule_update_root: New root: pool_size=1073741824 first_valid_entry=228626432 first_free_entry=228044800 flushed_sync_gen=19536
2021-08-19T15:37:02.030+0800 7f8398bc5700 0 librbd::cache::pwl::ssd::WriteLog: 0x7f836c0151b0 schedule_update_root: New root: pool_size=1073741824 first_valid_entry=228626432 first_free_entry=228696064 flushed_sync_gen=19536
>> new data will overwrite no-retire-log. This mean we judge that there is a problem with the condition that the cache is full. This because we repeat free allocation of space .
2:Wrong calculation of the location of WriteLogCacheEntry cause decode failed.