]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm pcache: fix segment info indexing
authorLi Chen <chenl311@chinatelecom.cn>
Fri, 5 Dec 2025 05:46:20 +0000 (05:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:17:03 +0000 (10:17 +0100)
commit527f5ea4ced1b3bc99f2cba619c4886ef6abe80d
treecac30c07181493e3b4227a31f265ccad07f35be8
parent87f7a7e2ed5715a120d4c601c2b67ae84525d2a2
dm pcache: fix segment info indexing

commit 13ea55ea20176736516b20b9ea2d8cf97dbe74f5 upstream.

Segment info indexing also used sizeof(struct) instead of the
4K metadata stride, so info_index could point between slots and
subsequent writes would advance incorrectly. Derive info_index
from the pointer returned by the segment meta search using
PCACHE_SEG_INFO_SIZE and advance to the next slot for future
updates.

Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
Signed-off-by: Dongsheng Yang <dongsheng.yang@linux.dev>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Zheng Gu <cengku@gmail.com>
Cc: stable@vger.kernel.org # 6.18
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-pcache/cache_segment.c