From: Mike Snitzer <snitzer@redhat.com>
To: James Bottomley <James.Bottomley@suse.de>
Cc: linux-scsi@vger.kernel.org, agk@redhat.com, jaxboe@fusionio.com,
Hannes Reinecke <hare@suse.de>,
michaelc@cs.wisc.edu, Mike Snitzer <snitzer@redhat.com>
Subject: [PATCH v3 3/3] block: improve detail in I/O error messages
Date: Fri, 14 Jan 2011 10:58:56 -0500 [thread overview]
Message-ID: <1295020736-27699-4-git-send-email-snitzer@redhat.com> (raw)
In-Reply-To: <1295020736-27699-1-git-send-email-snitzer@redhat.com>
Classify severity of I/O errors for target and transport errors.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Hannes Reinecke <hare@suse.de>
---
block/blk-core.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
Index: linux-2.6/block/blk-core.c
===================================================================
--- linux-2.6.orig/block/blk-core.c
+++ linux-2.6/block/blk-core.c
@@ -2044,9 +2044,23 @@ bool blk_update_request(struct request *
if (error && req->cmd_type == REQ_TYPE_FS &&
!(req->cmd_flags & REQ_QUIET)) {
- printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n",
- req->rq_disk ? req->rq_disk->disk_name : "?",
- (unsigned long long)blk_rq_pos(req));
+ char *error_type;
+
+ switch (error) {
+ case -ENOLINK:
+ error_type = "recoverable transport";
+ break;
+ case -EREMOTEIO:
+ error_type = "critical target";
+ break;
+ case -EIO:
+ default:
+ error_type = "I/O";
+ break;
+ }
+ printk(KERN_ERR "end_request: %s error, dev %s, sector %llu\n",
+ error_type, req->rq_disk ? req->rq_disk->disk_name : "?",
+ (unsigned long long)blk_rq_pos(req));
}
blk_account_io_completion(req, nr_bytes);
prev parent reply other threads:[~2011-01-14 15:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-14 15:58 [PATCH v3 0/3] differentiate between I/O errors Mike Snitzer
2011-01-14 15:58 ` [PATCH v3 1/3] scsi: Detailed " Mike Snitzer
2011-01-14 16:10 ` Jonathan McDowell
2011-01-14 17:16 ` Mike Snitzer
2011-01-17 15:52 ` Hannes Reinecke
2011-01-17 18:20 ` Mike Snitzer
2011-01-14 15:58 ` [PATCH v3 2/3] dm mpath: propagate target errors immediately Mike Snitzer
2011-01-14 15:58 ` Mike Snitzer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1295020736-27699-4-git-send-email-snitzer@redhat.com \
--to=snitzer@redhat.com \
--cc=James.Bottomley@suse.de \
--cc=agk@redhat.com \
--cc=hare@suse.de \
--cc=jaxboe@fusionio.com \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox