Skip to contentSkip to conversation

blkcg: put back rcu lock in blkcg_bio_issue_check()

PATCH Applied Dennis Zhou 2 participants 2 messages Dec 6, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 include/linux/blk-cgroup.h | 3 +++
 1 file changed, 3 insertions(+)
include/linux/blk-cgroup.h +3 -0
index 752de1becb5c..bf13ecb0fe4f 100644
@@ -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;
 }
 
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 2 lines · Dennis Zhou

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.

Applied, thanks Dennis.

Signature · 1 line
Jens Axboe