mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-30 07:34:12 +08:00
block: skip bio_check_eod for partition-remapped bios
When an already remapped bio is resubmitted (e.g. by blk_queue_split),
bio_check_eod will compare the remapped bi_sector against the size
of the partition, leading to spurious I/O failures.
Skip the EOD check in this case.
Fixes: 309dca309f
("block: store a block_device pointer in struct bio")
Reported-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
c42bca92be
commit
3a905c37c3
@ -815,11 +815,12 @@ static noinline_for_stack bool submit_bio_checks(struct bio *bio)
|
||||
goto end_io;
|
||||
if (unlikely(bio_check_ro(bio)))
|
||||
goto end_io;
|
||||
if (unlikely(bio_check_eod(bio)))
|
||||
goto end_io;
|
||||
if (bio->bi_bdev->bd_partno && !bio_flagged(bio, BIO_REMAPPED) &&
|
||||
unlikely(blk_partition_remap(bio)))
|
||||
goto end_io;
|
||||
if (!bio_flagged(bio, BIO_REMAPPED)) {
|
||||
if (unlikely(bio_check_eod(bio)))
|
||||
goto end_io;
|
||||
if (bdev->bd_partno && unlikely(blk_partition_remap(bio)))
|
||||
goto end_io;
|
||||
}
|
||||
|
||||
/*
|
||||
* Filter flush bio's early so that bio based drivers without flush
|
||||
|
Loading…
Reference in New Issue
Block a user