Message ID | 20190618054224.25985-2-chaitanya.kulkarni@wdc.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block: improve print_req_error | expand |
On 6/17/19 10:42 PM, Chaitanya Kulkarni wrote: > From: Christoph Hellwig <hch@lst.de> > > 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. > > Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> > Signed-off-by: Christoph Hellwig <hch@lst.de> Is Christoph the original author of this patch? In that case I think Christoph's signed-off-by should occur first and yours second. See also Documentation/process/submitting-patches.rst. Bart.
On 6/18/19 8:21 AM, Bart Van Assche wrote: > On 6/17/19 10:42 PM, Chaitanya Kulkarni wrote: >> From: Christoph Hellwig <hch@lst.de> >> >> 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. >> >> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> >> Signed-off-by: Christoph Hellwig <hch@lst.de> > > Is Christoph the original author of this patch? In that case I think > Christoph's signed-off-by should occur first and yours second. See also > Documentation/process/submitting-patches.rst. > > Bart. > Okay I'll do so.
diff --git a/block/blk-core.c b/block/blk-core.c index 8340f69670d8..6753231b529b 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -167,18 +167,20 @@ int blk_status_to_errno(blk_status_t status) } EXPORT_SYMBOL_GPL(blk_status_to_errno); -static void print_req_error(struct request *req, blk_status_t status) +static void print_req_error(struct request *req, blk_status_t status, + const char *caller) { int idx = (__force int)status; if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors))) return; - printk_ratelimited(KERN_ERR "%s: %s error, dev %s, sector %llu flags %x\n", - __func__, blk_errors[idx].name, - req->rq_disk ? req->rq_disk->disk_name : "?", - (unsigned long long)blk_rq_pos(req), - req->cmd_flags); + printk_ratelimited(KERN_ERR + "%s: %s error, dev %s, sector %llu op 0x%x flags 0x%x\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); } static void req_bio_endio(struct request *rq, struct bio *bio, @@ -1373,7 +1375,7 @@ bool blk_update_request(struct request *req, blk_status_t error, if (unlikely(error && !blk_rq_is_passthrough(req) && !(req->rq_flags & RQF_QUIET))) - print_req_error(req, error); + print_req_error(req, error, __func__); blk_account_io_completion(req, nr_bytes);