Skip to contentSkip to conversation

block: print the current process in handle_bad_sector

PATCH Applied Christoph Hellwig 4 participants 4 messages Sep 28, 2021 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: print the current process in handle_bad_sector

Make the bad sector information a little more useful by printing current->comm to identify the caller.

---
 block/blk-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-core.c +2 -1
index 5454db2fa263b..4c2a3db4bd336 100644
@@ -636,8 +636,9 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector)
 {
 	char b[BDEVNAME_SIZE];
 
-	pr_info_ratelimited("attempt to access beyond end of device\n"
+	pr_info_ratelimited("%s: attempt to access beyond end of device\n"
 			    "%s: rw=%d, want=%llu, limit=%llu\n",
+			    current->comm,
 			    bio_devname(bio, b), bio->bi_opf,
 			    bio_end_sector(bio), maxsector);
 }
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Christoph Hellwig

Make the bad sector information a little more useful by printing current->comm to identify the caller.

---
 block/blk-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
block/blk-core.c +0 -0
index 5454db2fa263b..4c2a3db4bd336 100644

block/blk-core.c static void handle_bad_sector(struct bio *bio, sector_t maxsector) · line 644

Quoted 10 lines
block/blk-core.c +2 -1
@@ -636,8 +636,9 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector)
 {
 	char b[BDEVNAME_SIZE];
 
-	pr_info_ratelimited("attempt to access beyond end of device\n"
+	pr_info_ratelimited("%s: attempt to access beyond end of device\n"
 			    "%s: rw=%d, want=%llu, limit=%llu\n",
+			    current->comm,
 			    bio_devname(bio, b), bio->bi_opf,
 			    bio_end_sector(bio), maxsector);
 }

Looks good. A stack dump, while noisier, would be even more useful :)

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

Make the bad sector information a little more useful by printing current->comm to identify the caller.

Applied, thanks.

Signature · 1 line
Jens Axboe