Commit 04474615 authored by Vincent Whitchurch's avatar Vincent Whitchurch Committed by Lecopzer Chen
Browse files

UPSTREAM: squashfs: fix cache race with migration

Migration replaces the page in the mapping before copying the contents and
the flags over from the old page, so check that the page in the page cache
is really up to date before using it.  Without this, stressing squashfs
reads with parallel compaction sometimes results in squashfs reporting
data corruption.

Link: https://lkml.kernel.org/r/20230629-squashfs-cache-migration-v1-1-d50ebe55099d@axis.com


Fixes: e994f5b6 ("squashfs: cache partial compressed blocks")
Signed-off-by: default avatarVincent Whitchurch <vincent.whitchurch@axis.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Phillip Lougher <phillip@squashfs.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>

Bug: 290900323
(cherry picked from commit 08bab74a)
Change-Id: I71307d68bede9e55521e5313ede5d57f9bc726bd
Signed-off-by: default avatarLecopzer Chen <lecopzer.chen@mediatek.com>
parent f15bd09d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment