linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: <linux-block@vger.kernel.org>
Cc: Paolo Valente <paolo.valente@linaro.org>,
	Jens Axboe <axboe@kernel.dk>, "yukuai (C)" <yukuai3@huawei.com>,
	Jan Kara <jack@suse.cz>,
	stable@vger.kernel.org
Subject: [PATCH 1/4] bfq: Avoid false marking of bic as stably merged
Date: Fri, 21 Jan 2022 11:56:42 +0100	[thread overview]
Message-ID: <20220121105816.27320-1-jack@suse.cz> (raw)
In-Reply-To: <20220121105503.14069-1-jack@suse.cz>

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: stable@vger.kernel.org
Fixes: 430a67f9d616 ("block, bfq: merge bursts of newly-created queues")
Signed-off-by: Jan Kara <jack@suse.cz>
---
 block/bfq-iosched.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index fec18118dc30..056399185c2f 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -2762,9 +2762,12 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq,
 				struct bfq_queue *new_bfqq =
 					bfq_setup_merge(bfqq, stable_merge_bfqq);
 
-				bic->stably_merged = true;
-				if (new_bfqq && new_bfqq->bic)
-					new_bfqq->bic->stably_merged = true;
+				if (new_bfqq) {
+					bic->stably_merged = true;
+					if (new_bfqq->bic)
+						new_bfqq->bic->stably_merged =
+									true;
+				}
 				return new_bfqq;
 			} else
 				return NULL;
-- 
2.31.1


  reply	other threads:[~2022-01-21 10:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21 10:56 [PATCH 0/4 v5] bfq: Avoid use-after-free when moving processes between cgroups Jan Kara
2022-01-21 10:56 ` Jan Kara [this message]
2022-01-21 10:56 ` [PATCH 2/4] bfq: Avoid merging queues with different parents Jan Kara
2022-01-21 10:56 ` [PATCH 3/4] bfq: Split shared queues on move between cgroups Jan Kara
2022-01-21 10:56 ` [PATCH 4/4] bfq: Update cgroup information before merging bio Jan Kara
     [not found] ` <4b44e8db-771f-fc08-85f1-52c326f3db18@huawei.com>
2022-01-21 12:28   ` [PATCH 0/4 v5] bfq: Avoid use-after-free when moving processes between cgroups yukuai (C)
2022-01-24 14:02   ` Jan Kara
     [not found]     ` <75bfe59d-c570-8c1c-5a3c-576791ea84ec@huawei.com>
     [not found]       ` <20220202190210.xppvatep47duofbq@quack3.lan>
2022-02-02 21:53         ` Jan Kara
2022-02-08  3:56           ` yukuai (C)
     [not found]           ` <6ec28c27-1dce-33e3-1cb7-2e08892471bb@huawei.com>
2022-02-09 17:40             ` Jan Kara
2022-03-11  6:39               ` yukuai (C)
2022-03-11 11:28                 ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2022-01-14 17:01 [PATCH 0/4 v4] " Jan Kara
2022-01-14 17:01 ` [PATCH 1/4] bfq: Avoid false marking of bic as stably merged Jan Kara
2022-01-12 11:39 [PATCH 0/4 v3] bfq: Avoid use-after-free when moving processes between cgroups Jan Kara
2022-01-12 11:39 ` [PATCH 1/4] bfq: Avoid false marking of bic as stably merged Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220121105816.27320-1-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=paolo.valente@linaro.org \
    --cc=stable@vger.kernel.org \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).