summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Zhou <dennis@kernel.org>2018-12-06 12:49:38 -0500
committerJens Axboe <axboe@kernel.dk>2018-12-07 22:26:38 -0700
commit4705de735b3383792c84a92e57508d6865caa85f (patch)
tree9dec9e8413951984cfc584d9b5e25424e2d1df3f
parentd3fcdff19054575a368dfdac7407cabffea36c43 (diff)
blkcg: put back rcu lock in blkcg_bio_issue_check()
I was a little overzealous in removing the rcu_read_lock() call from blkcg_bio_issue_check() and it broke blk-throttle. Put it back. Fixes: e35403a034bf ("blkcg: associate blkg when associating a device") Signed-off-by: Dennis Zhou <dennis@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--include/linux/blk-cgroup.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index 752de1becb5c..bf13ecb0fe4f 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -764,6 +764,8 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q,
struct blkcg_gq *blkg;
bool throtl = false;
+ rcu_read_lock();
+
if (!bio->bi_blkg) {
char b[BDEVNAME_SIZE];
@@ -791,6 +793,7 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q,
blkcg_bio_issue_init(bio);
+ rcu_read_unlock();
return !throtl;
}