Thread (5 messages) 5 messages, 2 authors, 2018-08-01
STALE2900d

[PATCH 2/3] blk-cgroup: hold the queue ref during throttling

From: Josef Bacik <josef@toxicpanda.com>
Date: 2018-07-31 16:39:03
Subsystem: block layer, control group - block io controller (blkio), the rest · Maintainers: Jens Axboe, Tejun Heo, Josef Bacik, Linus Torvalds

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>
---
 block/blk-cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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();
-- 
2.14.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help