Skip to contentSkip to conversation

block: improve I/O error print consistency

PATCH New Robert Elliott 1 participant 3 messages Aug 27, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover block: improve I/O error print consistency

The following series improves some of the ratelimited I/O error prints so what is being ratelimited is clearer.

---

Robert Elliott (2):
block: make blk_update_request print prefix match ratelimited prefix
block: include func name in __get_request prints

 block/blk-core.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
Rob Elliott, HP Server Storage  [email protected]
#1 lore raw

PATCH 1/2 block: make blk_update_request print prefix match ratelimited prefix

In blk_update_request, change the printk_ratelimited prefix from end_request to blk_update_request so it matches the name printed if rate limiting occurs.

Old:

[10234.933106] blk_update_request: 174 callbacks suppressed
[10234.934940] end_request: critical target error, dev sdr, sector 16
[10234.949788] end_request: critical target error, dev sdr, sector 16

New:

[16863.445173] blk_update_request: 398 callbacks suppressed
[16863.447029] blk_update_request: critical target error, dev sdr, sector
1442066176
[16863.449383] blk_update_request: critical target error, dev sdr, sector
802802888
[16863.451680] blk_update_request: critical target error, dev sdr, sector

1609535456

---
 block/blk-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
block/blk-core.c +2 -2
index c359d72..9c5a5b9 100644
@@ -2450,8 +2450,8 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)
 			error_type = "I/O";
 			break;
 		}
-		printk_ratelimited(KERN_ERR "end_request: %s error, dev %s, sector %llu\n",
-				   error_type, req->rq_disk ?
+		printk_ratelimited(KERN_ERR "%s: %s error, dev %s, sector %llu\n",
+				   __func__, error_type, req->rq_disk ?
 				   req->rq_disk->disk_name : "?",
 				   (unsigned long long)blk_rq_pos(req));
 
#2 lore raw

PATCH 2/2 block: include func name in __get_request prints

In reply to Robert Elliott

In __get_request calls to printk_ratelimited, include the function name so the callbacks suppressed message matches the messages that are printed, and add "dev" before the device name so it matches other block layer messages.

---
 block/blk-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
block/blk-core.c +2 -2
index 9c5a5b9..204cbd3 100644
@@ -1065,8 +1065,8 @@ fail_elvpriv:
 	 * shouldn't stall IO.  Treat this request as !elvpriv.  This will
 	 * disturb iosched and blkcg but weird is bettern than dead.
 	 */
-	printk_ratelimited(KERN_WARNING "%s: request aux data allocation failed, iosched may be disturbed\n",
-			   dev_name(q->backing_dev_info.dev));
+	printk_ratelimited(KERN_WARNING "%s: dev %s: request aux data allocation failed, iosched may be disturbed\n",
+			   __func__, dev_name(q->backing_dev_info.dev));
 
 	rq->cmd_flags &= ~REQ_ELVPRIV;
 	rq->elv.icq = NULL;