diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-merge.c | 2 | ||||
-rw-r--r-- | block/blk-mq-tag.c | 6 | ||||
-rw-r--r-- | block/blk-mq.c | 6 | ||||
-rw-r--r-- | block/blk-settings.c | 6 |
4 files changed, 11 insertions, 9 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c index fc1ff3b1ea1f..fd3fee81c23c 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
@@ -592,7 +592,7 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) | |||
592 | if (q->queue_flags & (1 << QUEUE_FLAG_SG_GAPS)) { | 592 | if (q->queue_flags & (1 << QUEUE_FLAG_SG_GAPS)) { |
593 | struct bio_vec *bprev; | 593 | struct bio_vec *bprev; |
594 | 594 | ||
595 | bprev = &rq->biotail->bi_io_vec[bio->bi_vcnt - 1]; | 595 | bprev = &rq->biotail->bi_io_vec[rq->biotail->bi_vcnt - 1]; |
596 | if (bvec_gap_to_prev(bprev, bio->bi_io_vec[0].bv_offset)) | 596 | if (bvec_gap_to_prev(bprev, bio->bi_io_vec[0].bv_offset)) |
597 | return false; | 597 | return false; |
598 | } | 598 | } |
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index d53a764b05ea..be3290cc0644 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c | |||
@@ -278,9 +278,11 @@ static int bt_get(struct blk_mq_alloc_data *data, | |||
278 | /* | 278 | /* |
279 | * We're out of tags on this hardware queue, kick any | 279 | * We're out of tags on this hardware queue, kick any |
280 | * pending IO submits before going to sleep waiting for | 280 | * pending IO submits before going to sleep waiting for |
281 | * some to complete. | 281 | * some to complete. Note that hctx can be NULL here for |
282 | * reserved tag allocation. | ||
282 | */ | 283 | */ |
283 | blk_mq_run_hw_queue(hctx, false); | 284 | if (hctx) |
285 | blk_mq_run_hw_queue(hctx, false); | ||
284 | 286 | ||
285 | /* | 287 | /* |
286 | * Retry tag allocation after running the hardware queue, | 288 | * Retry tag allocation after running the hardware queue, |
diff --git a/block/blk-mq.c b/block/blk-mq.c index 4f4bea21052e..b7b8933ec241 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -1938,7 +1938,7 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) | |||
1938 | */ | 1938 | */ |
1939 | if (percpu_ref_init(&q->mq_usage_counter, blk_mq_usage_counter_release, | 1939 | if (percpu_ref_init(&q->mq_usage_counter, blk_mq_usage_counter_release, |
1940 | PERCPU_REF_INIT_ATOMIC, GFP_KERNEL)) | 1940 | PERCPU_REF_INIT_ATOMIC, GFP_KERNEL)) |
1941 | goto err_map; | 1941 | goto err_mq_usage; |
1942 | 1942 | ||
1943 | setup_timer(&q->timeout, blk_mq_rq_timer, (unsigned long) q); | 1943 | setup_timer(&q->timeout, blk_mq_rq_timer, (unsigned long) q); |
1944 | blk_queue_rq_timeout(q, 30000); | 1944 | blk_queue_rq_timeout(q, 30000); |
@@ -1981,7 +1981,7 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) | |||
1981 | blk_mq_init_cpu_queues(q, set->nr_hw_queues); | 1981 | blk_mq_init_cpu_queues(q, set->nr_hw_queues); |
1982 | 1982 | ||
1983 | if (blk_mq_init_hw_queues(q, set)) | 1983 | if (blk_mq_init_hw_queues(q, set)) |
1984 | goto err_hw; | 1984 | goto err_mq_usage; |
1985 | 1985 | ||
1986 | mutex_lock(&all_q_mutex); | 1986 | mutex_lock(&all_q_mutex); |
1987 | list_add_tail(&q->all_q_node, &all_q_list); | 1987 | list_add_tail(&q->all_q_node, &all_q_list); |
@@ -1993,7 +1993,7 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *set) | |||
1993 | 1993 | ||
1994 | return q; | 1994 | return q; |
1995 | 1995 | ||
1996 | err_hw: | 1996 | err_mq_usage: |
1997 | blk_cleanup_queue(q); | 1997 | blk_cleanup_queue(q); |
1998 | err_hctxs: | 1998 | err_hctxs: |
1999 | kfree(map); | 1999 | kfree(map); |
diff --git a/block/blk-settings.c b/block/blk-settings.c index 6ed2cbe5e8c9..12600bfffca9 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c | |||
@@ -585,7 +585,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | |||
585 | b->physical_block_size); | 585 | b->physical_block_size); |
586 | 586 | ||
587 | t->io_min = max(t->io_min, b->io_min); | 587 | t->io_min = max(t->io_min, b->io_min); |
588 | t->io_opt = lcm(t->io_opt, b->io_opt); | 588 | t->io_opt = lcm_not_zero(t->io_opt, b->io_opt); |
589 | 589 | ||
590 | t->cluster &= b->cluster; | 590 | t->cluster &= b->cluster; |
591 | t->discard_zeroes_data &= b->discard_zeroes_data; | 591 | t->discard_zeroes_data &= b->discard_zeroes_data; |
@@ -616,7 +616,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | |||
616 | b->raid_partial_stripes_expensive); | 616 | b->raid_partial_stripes_expensive); |
617 | 617 | ||
618 | /* Find lowest common alignment_offset */ | 618 | /* Find lowest common alignment_offset */ |
619 | t->alignment_offset = lcm(t->alignment_offset, alignment) | 619 | t->alignment_offset = lcm_not_zero(t->alignment_offset, alignment) |
620 | % max(t->physical_block_size, t->io_min); | 620 | % max(t->physical_block_size, t->io_min); |
621 | 621 | ||
622 | /* Verify that new alignment_offset is on a logical block boundary */ | 622 | /* Verify that new alignment_offset is on a logical block boundary */ |
@@ -643,7 +643,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | |||
643 | b->max_discard_sectors); | 643 | b->max_discard_sectors); |
644 | t->discard_granularity = max(t->discard_granularity, | 644 | t->discard_granularity = max(t->discard_granularity, |
645 | b->discard_granularity); | 645 | b->discard_granularity); |
646 | t->discard_alignment = lcm(t->discard_alignment, alignment) % | 646 | t->discard_alignment = lcm_not_zero(t->discard_alignment, alignment) % |
647 | t->discard_granularity; | 647 | t->discard_granularity; |
648 | } | 648 | } |
649 | 649 | ||