Skip to content

Commit 70456e5

Browse files
jankaraaxboe
authored andcommitted
bfq: Avoid false marking of bic as stably merged
bfq_setup_cooperator() can mark bic as stably merged even though it decides to not merge its bfqqs (when bfq_setup_merge() returns NULL). Make sure to mark bic as stably merged only if we are really going to merge bfqqs. CC: [email protected] Tested-by: "yukuai (C)" <[email protected]> Fixes: 430a67f ("block, bfq: merge bursts of newly-created queues") Signed-off-by: Jan Kara <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 852ad96 commit 70456e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

block/bfq-iosched.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,9 +2895,12 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq,
28952895
struct bfq_queue *new_bfqq =
28962896
bfq_setup_merge(bfqq, stable_merge_bfqq);
28972897

2898-
bic->stably_merged = true;
2899-
if (new_bfqq && new_bfqq->bic)
2900-
new_bfqq->bic->stably_merged = true;
2898+
if (new_bfqq) {
2899+
bic->stably_merged = true;
2900+
if (new_bfqq->bic)
2901+
new_bfqq->bic->stably_merged =
2902+
true;
2903+
}
29012904
return new_bfqq;
29022905
} else
29032906
return NULL;

0 commit comments

Comments
 (0)