]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: Fix silent short reads in data read retry path
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 24 Mar 2025 15:51:01 +0000 (11:51 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Tue, 25 Mar 2025 15:49:16 +0000 (11:49 -0400)
commit3ba0240a8789f8c059990b81c6f34c29769a5a49
tree56cd7536228392bcc3bfc70916e24e9bb73e01eb
parent5af61dbd96275e184adcfe615507b0f04ed7b328
bcachefs: Fix silent short reads in data read retry path

__bch2_read, before calling __bch2_read_extent(), sets bvec_iter.bi_size
to "the size we can read from the current extent" with a swap, and
restores it to "the size for the total read" after the read_extent call
with another swap.

But we neglected to do the restore before the "if (ret) goto err;" -
which is a problem if we're retrying those errors.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs-io-buffered.c
fs/bcachefs/io_read.c
fs/bcachefs/io_read.h