aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-06-20 13:59:15 -0400
committerJens Axboe <axboe@kernel.dk>2019-06-20 15:03:51 -0400
commit178cc590e54a9e04a749a0474fcaac0e8c20888f (patch)
treeb325e1a83b53bfaef05e4ff98f0cdbf5d2bc6cf4 /block
parent8060c47ba853f147c46bf1e6f6d93d1726fcb57a (diff)
block: improve print_req_error
Print the calling function instead of print_req_error as a prefix, and print the operation and op_flags separately instead of the whole field. Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index e1b77113671e..c97da29ddc07 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -167,18 +167,20 @@ int blk_status_to_errno(blk_status_t status)
167} 167}
168EXPORT_SYMBOL_GPL(blk_status_to_errno); 168EXPORT_SYMBOL_GPL(blk_status_to_errno);
169 169
170static void print_req_error(struct request *req, blk_status_t status) 170static void print_req_error(struct request *req, blk_status_t status,
171 const char *caller)
171{ 172{
172 int idx = (__force int)status; 173 int idx = (__force int)status;
173 174
174 if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors))) 175 if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors)))
175 return; 176 return;
176 177
177 printk_ratelimited(KERN_ERR "%s: %s error, dev %s, sector %llu flags %x\n", 178 printk_ratelimited(KERN_ERR
178 __func__, blk_errors[idx].name, 179 "%s: %s error, dev %s, sector %llu op 0x%x flags 0x%x\n",
179 req->rq_disk ? req->rq_disk->disk_name : "?", 180 caller, blk_errors[idx].name,
180 (unsigned long long)blk_rq_pos(req), 181 req->rq_disk ? req->rq_disk->disk_name : "?",
181 req->cmd_flags); 182 blk_rq_pos(req), req_op(req),
183 req->cmd_flags & ~REQ_OP_MASK);
182} 184}
183 185
184static void req_bio_endio(struct request *rq, struct bio *bio, 186static void req_bio_endio(struct request *rq, struct bio *bio,
@@ -1362,7 +1364,7 @@ bool blk_update_request(struct request *req, blk_status_t error,
1362 1364
1363 if (unlikely(error && !blk_rq_is_passthrough(req) && 1365 if (unlikely(error && !blk_rq_is_passthrough(req) &&
1364 !(req->rq_flags & RQF_QUIET))) 1366 !(req->rq_flags & RQF_QUIET)))
1365 print_req_error(req, error); 1367 print_req_error(req, error, __func__);
1366 1368
1367 blk_account_io_completion(req, nr_bytes); 1369 blk_account_io_completion(req, nr_bytes);
1368 1370