[PATCH 2/5] block: update error message in submit_bio()

Chaitanya Kulkarni
2019-07-01T21:57:51Z

The existing code in the submit_bio() relies on the op_is_write().
op_is_write() checks for the last bit in the bio_op() and we only
print WRITE or READ as a bio_op().

It is hard to understand which bio op based on READ/WRITE in
submit_bio() with addition of newly discussed REQ_OP_XXX. [1]

Modify the error message in submit_bio() to print correct REQ_OP_XXX
with the help of blk_op_str().

[1] https://www.spinics.net/lists/linux-block/msg41884.html.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
block/blk-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 47c8b9c48a57..5143a8e19b63 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1150,7 +1150,7 @@ blk_qc_t submit_bio(struct bio *bio)
char b[BDEVNAME_SIZE];
printk(KERN_DEBUG "%s(%d): %s block %Lu on %s (%u sectors)\n",
current->comm, task_pid_nr(current),
- op_is_write(bio_op(bio)) ? "WRITE" : "READ",
+ blk_op_str(bio_op(bio)),
(unsigned long long)bio->bi_iter.bi_sector,
bio_devname(bio, b), count);
}
--
2.21.0