Skip to content

Commit a2fa8a1

Browse files
maciejsszmigieroaxboe
authored andcommitted
cfq: clear queue pointers from cfqg after unpinning them in cfq_pd_offline
BFQ is already doing a similar thing in its .pd_offline_fn() method implementation. While it seems that after commit 4c69948 ("blk-throttle: fix race between blkcg_bio_issue_check() and cgroup_rmdir()") was reverted leaving these pointers intact no longer causes crashes clearing them is still a sensible thing to do to make the code more robust. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 4822e90 commit a2fa8a1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

block/cfq-iosched.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,14 +1644,20 @@ static void cfq_pd_offline(struct blkg_policy_data *pd)
16441644
int i;
16451645

16461646
for (i = 0; i < IOPRIO_BE_NR; i++) {
1647-
if (cfqg->async_cfqq[0][i])
1647+
if (cfqg->async_cfqq[0][i]) {
16481648
cfq_put_queue(cfqg->async_cfqq[0][i]);
1649-
if (cfqg->async_cfqq[1][i])
1649+
cfqg->async_cfqq[0][i] = NULL;
1650+
}
1651+
if (cfqg->async_cfqq[1][i]) {
16501652
cfq_put_queue(cfqg->async_cfqq[1][i]);
1653+
cfqg->async_cfqq[1][i] = NULL;
1654+
}
16511655
}
16521656

1653-
if (cfqg->async_idle_cfqq)
1657+
if (cfqg->async_idle_cfqq) {
16541658
cfq_put_queue(cfqg->async_idle_cfqq);
1659+
cfqg->async_idle_cfqq = NULL;
1660+
}
16551661

16561662
/*
16571663
* @blkg is going offline and will be ignored by

0 commit comments

Comments
 (0)