diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-02-12 02:32:11 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:20 -0400 |
commit | 8d65e475b20610854419fef8dba155200b45a687 (patch) | |
tree | 9060c45146e7eae759d44c433a6757807afd9da9 /fs | |
parent | 5b2e599f506891eec8163c1d90800168a0016d14 (diff) | |
download | lwn-8d65e475b20610854419fef8dba155200b45a687.tar.gz lwn-8d65e475b20610854419fef8dba155200b45a687.zip |
bcachefs: Always check for bucket reuse after read
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/io.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index d69e63e519bf..f172da922904 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -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) |