Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iomap: fix submission side handling of completion side errors

The "if (dio->error)" in iomap_dio_bio_iter exists to stop submitting
more bios when a completion already return an error. Commit cfe057f7db1f
("iomap_dio_actor(): fix iov_iter bugs") made it revert the iov by
"copied", which is very wrong given that we've already consumed that
range and submitted a bio for it.

Fixes: cfe057f7db1f ("iomap_dio_actor(): fix iov_iter bugs")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
4ad357e3 8dd5e7c7

+7 -3
+7 -3
fs/iomap/direct-io.c
··· 443 443 nr_pages = bio_iov_vecs_to_alloc(dio->submit.iter, BIO_MAX_VECS); 444 444 do { 445 445 size_t n; 446 - if (dio->error) { 447 - iov_iter_revert(dio->submit.iter, copied); 448 - copied = ret = 0; 446 + 447 + /* 448 + * If completions already occurred and reported errors, give up now and 449 + * don't bother submitting more bios. 450 + */ 451 + if (unlikely(data_race(dio->error))) { 452 + ret = 0; 449 453 goto out; 450 454 } 451 455