Skip to content

Commit

Permalink
block: improve the error message from bio_check_eod
Browse files Browse the repository at this point in the history
Print the start sector and length separately instead of the combined
value to help with debugging.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed May 5, 2022
1 parent 7ecc56c commit 069adba
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,9 @@ static inline int bio_check_eod(struct bio *bio)
(nr_sectors > maxsector ||
bio->bi_iter.bi_sector > maxsector - nr_sectors)) {
pr_info_ratelimited("%s: attempt to access beyond end of device\n"
"%pg: rw=%d, want=%llu, limit=%llu\n",
current->comm,
bio->bi_bdev, bio->bi_opf,
bio_end_sector(bio), maxsector);
"%pg: rw=%d, sector=%llu, nr_sectors = %u limit=%llu\n",
current->comm, bio->bi_bdev, bio->bi_opf,
bio->bi_iter.bi_sector, nr_sectors, maxsector);
return -EIO;
}
return 0;
Expand Down

0 comments on commit 069adba

Please sign in to comment.