[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181020185612.51587-2-dennis@kernel.org>
Date: Sat, 20 Oct 2018 14:56:11 -0400
From: Dennis Zhou <dennis@...nel.org>
To: Jens Axboe <axboe@...nel.dk>
Cc: Tejun Heo <tj@...nel.org>,
Valdis Kletnieks <valdis.kletnieks@...edu>, kernel-team@...com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Dennis Zhou <dennis@...nel.org>
Subject: [PATCH 1/2] blkcg: fix edge case for blk_get_rl() under memory pressure
It is possible for blkg creation to fail when in blk_get_rl(). In this
situation, the fallback logic returns the nearest created blkg. There is
however special handling for the request_list for the root blkcg. This
fixes the missing edge case from the earlier series changing
blk_get_rl().
Fixes: e2b0989954ae ("blkcg: cleanup and make blk_get_rl use blkg_lookup_create")
Signed-off-by: Dennis Zhou <dennis@...nel.org>
---
include/linux/blk-cgroup.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index b7fd08013de2..1e76ceebeb5d 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -597,7 +597,7 @@ static inline struct request_list *blk_get_rl(struct request_queue *q,
if (unlikely(!blkg))
blkg = __blkg_lookup_create(blkcg, q);
- if (!blkg_tryget(blkg))
+ if (blkg->blkcg == &blkcg_root || !blkg_tryget(blkg))
goto rl_use_root;
rcu_read_unlock();
--
2.17.1
Powered by blists - more mailing lists