aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2011-01-18 04:13:13 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-12 11:33:37 -0500
commit79775567e0439ca47eb9f501e52c4b713d44cf89 (patch)
tree1cb890e0a061b007ae10bd281a60ada60a6d2bb1 /block
parent751b2a7d623ead9e55f751a6087efeab454b5659 (diff)
[SCSI] block: improve detail in I/O error messages
Classify severity of I/O errors for target, nexus, and transport errors. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Jens Axboe <jaxboe@fusionio.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 2f4002f79a24..b3cf121f1de9 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2044,9 +2044,26 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)
2044 2044
2045 if (error && req->cmd_type == REQ_TYPE_FS && 2045 if (error && req->cmd_type == REQ_TYPE_FS &&
2046 !(req->cmd_flags & REQ_QUIET)) { 2046 !(req->cmd_flags & REQ_QUIET)) {
2047 printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n", 2047 char *error_type;
2048 req->rq_disk ? req->rq_disk->disk_name : "?", 2048
2049 (unsigned long long)blk_rq_pos(req)); 2049 switch (error) {
2050 case -ENOLINK:
2051 error_type = "recoverable transport";
2052 break;
2053 case -EREMOTEIO:
2054 error_type = "critical target";
2055 break;
2056 case -EBADE:
2057 error_type = "critical nexus";
2058 break;
2059 case -EIO:
2060 default:
2061 error_type = "I/O";
2062 break;
2063 }
2064 printk(KERN_ERR "end_request: %s error, dev %s, sector %llu\n",
2065 error_type, req->rq_disk ? req->rq_disk->disk_name : "?",
2066 (unsigned long long)blk_rq_pos(req));
2050 } 2067 }
2051 2068
2052 blk_account_io_completion(req, nr_bytes); 2069 blk_account_io_completion(req, nr_bytes);