aboutsummaryrefslogtreecommitdiff
path: root/block/blk-iocost.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-07-22 11:05:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-07-22 11:05:15 -0700
commitf036d67c02b6f6966b0d45e9a16c9f2e7ede80a3 (patch)
tree5b8183940408ed9b79203a9055f1389422ce1050 /block/blk-iocost.c
parentbdd1d82e7d02bd2764a68a5cc54533dfc2ba452a (diff)
parentbb5faa99f0ce40756ab7bbbce4f16c01ca5ebd5a (diff)
Merge tag 'block-6.5-2023-07-21' of git://git.kernel.dk/linux
Pull block fixes from Jens Axboe: - Fix for loop regressions (Mauricio) - Fix a potential stall with batched wakeups in sbitmap (David) - Fix for stall with recursive plug flushes (Ross) - Skip accounting of empty requests for blk-iocost (Chengming) - Remove a dead field in struct blk_mq_hw_ctx (Chengming) * tag 'block-6.5-2023-07-21' of git://git.kernel.dk/linux: loop: do not enforce max_loop hard limit by (new) default loop: deprecate autoloading callback loop_probe() sbitmap: fix batching wakeup blk-iocost: skip empty flush bio in iocost blk-mq: delete dead struct blk_mq_hw_ctx->queued field blk-mq: Fix stall due to recursive flush plug
Diffstat (limited to 'block/blk-iocost.c')
-rw-r--r--block/blk-iocost.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 9dfcf540f400..dd64e2066f01 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -2516,6 +2516,10 @@ static void calc_vtime_cost_builtin(struct bio *bio, struct ioc_gq *iocg,
u64 seek_pages = 0;
u64 cost = 0;
+ /* Can't calculate cost for empty bio */
+ if (!bio->bi_iter.bi_size)
+ goto out;
+
switch (bio_op(bio)) {
case REQ_OP_READ:
coef_seqio = ioc->params.lcoefs[LCOEF_RSEQIO];