diff options
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 518dd423a5fe..a63336d49f30 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -2045,9 +2045,26 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes) | |||
2045 | 2045 | ||
2046 | if (error && req->cmd_type == REQ_TYPE_FS && | 2046 | if (error && req->cmd_type == REQ_TYPE_FS && |
2047 | !(req->cmd_flags & REQ_QUIET)) { | 2047 | !(req->cmd_flags & REQ_QUIET)) { |
2048 | printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n", | 2048 | char *error_type; |
2049 | req->rq_disk ? req->rq_disk->disk_name : "?", | 2049 | |
2050 | (unsigned long long)blk_rq_pos(req)); | 2050 | switch (error) { |
2051 | case -ENOLINK: | ||
2052 | error_type = "recoverable transport"; | ||
2053 | break; | ||
2054 | case -EREMOTEIO: | ||
2055 | error_type = "critical target"; | ||
2056 | break; | ||
2057 | case -EBADE: | ||
2058 | error_type = "critical nexus"; | ||
2059 | break; | ||
2060 | case -EIO: | ||
2061 | default: | ||
2062 | error_type = "I/O"; | ||
2063 | break; | ||
2064 | } | ||
2065 | printk(KERN_ERR "end_request: %s error, dev %s, sector %llu\n", | ||
2066 | error_type, req->rq_disk ? req->rq_disk->disk_name : "?", | ||
2067 | (unsigned long long)blk_rq_pos(req)); | ||
2051 | } | 2068 | } |
2052 | 2069 | ||
2053 | blk_account_io_completion(req, nr_bytes); | 2070 | blk_account_io_completion(req, nr_bytes); |