summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2018-07-31 18:39:03 +0200
committerJens Axboe <axboe@kernel.dk>2018-08-01 17:16:03 +0200
commitcc7ecc258562b065ef638c4b45e20953d57fb564 (patch)
treeede12ab4add1b486c0f34eb925cfca76853a4faa /block
parentblk-iolatency: fix blkg leak in timer_fn (diff)
downloadlinux-cc7ecc258562b065ef638c4b45e20953d57fb564.tar.xz
linux-cc7ecc258562b065ef638c4b45e20953d57fb564.zip
blk-cgroup: hold the queue ref during throttling
The blkg lifetime is protected by the queue lifetime, so we need to put the queue _after_ we're done using the blkg. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 1942357d7165..694595b29b8f 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1759,10 +1759,10 @@ void blkcg_maybe_throttle_current(void)
if (!blkg)
goto out;
rcu_read_unlock();
- blk_put_queue(q);
blkcg_maybe_throttle_blkg(blkg, use_memdelay);
blkg_put(blkg);
+ blk_put_queue(q);
return;
out:
rcu_read_unlock();