]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: Always check for bucket reuse after read
authorKent Overstreet <kent.overstreet@gmail.com>
Sat, 12 Feb 2022 07:32:11 +0000 (02:32 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:20 +0000 (17:09 -0400)
Since dirty extents can be moved or overwritten, it's not just cached
data that we need the ptr_stale() check in bc2h_read_endio for - this
fixes data checksum errors seen in the tiering ktest tests.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/io.c

index d69e63e519bf988967a6e2b7654c239dd3c6a80a..f172da9229045d3320d68ecc21fc14ed34c91a3b 100644 (file)
@@ -1972,9 +1972,8 @@ static void bch2_read_endio(struct bio *bio)
                return;
        }
 
-       if (rbio->pick.ptr.cached &&
-           (((rbio->flags & BCH_READ_RETRY_IF_STALE) && race_fault()) ||
-            ptr_stale(ca, &rbio->pick.ptr))) {
+       if (((rbio->flags & BCH_READ_RETRY_IF_STALE) && race_fault()) ||
+           ptr_stale(ca, &rbio->pick.ptr)) {
                atomic_long_inc(&c->read_realloc_races);
 
                if (rbio->flags & BCH_READ_RETRY_IF_STALE)