]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/cache/pwl/ssd: fix first_valid_entry calculation in retire_entries() 42843/head
authorJianpeng Ma <jianpeng.ma@intel.com>
Fri, 20 Aug 2021 06:29:37 +0000 (14:29 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 25 Aug 2021 11:07:52 +0000 (13:07 +0200)
commit2d337fb122d147e32d027d1e7211cd4156a5b72b
tree748ad2759c343e10a5537297cc6a0ab9906d4be3
parent4e6fbccea448124a868af72bf16f115798d4b8d1
librbd/cache/pwl/ssd: fix first_valid_entry calculation in retire_entries()

Consider one control_block which cotain multi encode(WriteLogCacheEntry):
Log1: WriteLogEntry
Log2: WriteLogEntry
Log3: Non-WriteLogEntry
For this case, currently calc method is: control_block_pos + sizeof(control_block).
But in fact, it should: control_block_pos + sizeof(control_block) +
data_length(Log1 + Log2).

Wrong first_valid_entry will persist to superblock and restart to read.
This cause read wrong position and when decode(WriteLogCacheEntry) it
will report bug.

Fixes: https://tracker.ceph.com/issues/52323
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/librbd/cache/pwl/ssd/WriteLog.cc