Skip to contentSkip to conversation

block: improve the error message from bio_check_eod

PATCH Applied Christoph Hellwig 3 participants 3 messages May 4, 2022 – May 5, 2022 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: improve the error message from bio_check_eod

Print the start sector and length separately instead of the combined value to help with debugging.

---
 block/blk-core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
block/blk-core.c +3 -4
index 937bb6b863317..10b32a1cc42b7 100644
@@ -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;
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Christoph Hellwig

Print the start sector and length separately instead of the combined value to help with debugging.

---
 block/blk-core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
block/blk-core.c +0 -0
index 937bb6b863317..10b32a1cc42b7 100644
@@ -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"

block/blk-core.c static inline int bio_check_eod(struct bio *bio) · line 600

Quoted 10 lines
block/blk-core.c +3 -4
-				    "%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;

Looks good.

Signature · 2 lines
Damien Le Moal
Western Digital Research
maintainer Applied
#2 lore raw
In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

Print the start sector and length separately instead of the combined value to help with debugging.

Applied, thanks!

[1/1] block: improve the error message from bio_check_eod

      commit: 069adbac2cd85ae00252da6c5576cbf9b9d9ba6e

Best regards,

Signature · 1 line
Jens Axboe