linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blkcg: put back rcu lock in blkcg_bio_issue_check()
@ 2018-12-06 17:49 Dennis Zhou
  2018-12-06 17:51 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Dennis Zhou @ 2018-12-06 17:49 UTC (permalink / raw)
  To: Jens Axboe, Tejun Heo, Johannes Weiner, Josef Bacik
  Cc: kernel-team, linux-block, cgroups, linux-kernel, 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.

Fixes: e35403a034bf ("blkcg: associate blkg when associating a device")
Signed-off-by: Dennis Zhou <dennis@kernel.org>
---
 include/linux/blk-cgroup.h | 3 +++
 1 file changed, 3 insertions(+)

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;
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] blkcg: put back rcu lock in blkcg_bio_issue_check()
  2018-12-06 17:49 [PATCH] blkcg: put back rcu lock in blkcg_bio_issue_check() Dennis Zhou
@ 2018-12-06 17:51 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2018-12-06 17:51 UTC (permalink / raw)
  To: Dennis Zhou, Tejun Heo, Johannes Weiner, Josef Bacik
  Cc: kernel-team, linux-block, cgroups, linux-kernel

On 12/6/18 10:49 AM, Dennis Zhou wrote:
> 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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-06 17:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06 17:49 [PATCH] blkcg: put back rcu lock in blkcg_bio_issue_check() Dennis Zhou
2018-12-06 17:51 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).