]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
block: print offending values when cloned rq limits are exceeded
authorJohn Pittman <jpittman@redhat.com>
Thu, 23 May 2019 21:49:39 +0000 (17:49 -0400)
committerJens Axboe <axboe@kernel.dk>
Fri, 31 May 2019 21:12:34 +0000 (15:12 -0600)
While troubleshooting issues where cloned request limits have been
exceeded, it is often beneficial to know the actual values that
have been breached.  Print these values, assisting in ease of
identification of root cause of the breach.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: John Pittman <jpittman@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c

index e6a273da4559868eed8058bb6738037b7c102fc5..ee1b35fe85726790566534641ebc79b91d7117ee 100644 (file)
@@ -1138,7 +1138,9 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
                                      struct request *rq)
 {
        if (blk_rq_sectors(rq) > blk_queue_get_max_sectors(q, req_op(rq))) {
-               printk(KERN_ERR "%s: over max size limit.\n", __func__);
+               printk(KERN_ERR "%s: over max size limit. (%u > %u)\n",
+                       __func__, blk_rq_sectors(rq),
+                       blk_queue_get_max_sectors(q, req_op(rq)));
                return -EIO;
        }
 
@@ -1150,7 +1152,8 @@ static int blk_cloned_rq_check_limits(struct request_queue *q,
         */
        blk_recalc_rq_segments(rq);
        if (rq->nr_phys_segments > queue_max_segments(q)) {
-               printk(KERN_ERR "%s: over max segments limit.\n", __func__);
+               printk(KERN_ERR "%s: over max segments limit. (%hu > %hu)\n",
+                       __func__, rq->nr_phys_segments, queue_max_segments(q));
                return -EIO;
        }