Skip to content

Commit

Permalink
block: update print_req_error()
Browse files Browse the repository at this point in the history
Improve the print_req_error with additional request fields which are
helpful for debugging. Use newly introduced blk_op_str() to print the
REQ_OP_XXX in the string format.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Chaitanya Kulkarni authored and Jens Axboe committed Jun 20, 2019
1 parent 874c893 commit b0e5168
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,14 @@ static void print_req_error(struct request *req, blk_status_t status,
return;

printk_ratelimited(KERN_ERR
"%s: %s error, dev %s, sector %llu op 0x%x flags 0x%x\n",
"%s: %s error, dev %s, sector %llu op 0x%x:(%s) flags 0x%x "
"phys_seg %u prio class %u\n",
caller, blk_errors[idx].name,
req->rq_disk ? req->rq_disk->disk_name : "?",
blk_rq_pos(req), req_op(req),
req->cmd_flags & ~REQ_OP_MASK);
req->rq_disk ? req->rq_disk->disk_name : "?",
blk_rq_pos(req), req_op(req), blk_op_str(req_op(req)),
req->cmd_flags & ~REQ_OP_MASK,
req->nr_phys_segments,
IOPRIO_PRIO_CLASS(req->ioprio));
}

static void req_bio_endio(struct request *rq, struct bio *bio,
Expand Down

0 comments on commit b0e5168

Please sign in to comment.