Skip to content

Commit b2c3fa5

Browse files
dennisszhouaxboe
authored andcommitted
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: e2b0989 ("blkcg: cleanup and make blk_get_rl use blkg_lookup_create") Signed-off-by: Dennis Zhou <dennis@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent bbc1528 commit b2c3fa5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/blk-cgroup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ static inline struct request_list *blk_get_rl(struct request_queue *q,
597597
if (unlikely(!blkg))
598598
blkg = __blkg_lookup_create(blkcg, q);
599599

600-
if (!blkg_tryget(blkg))
600+
if (blkg->blkcg == &blkcg_root || !blkg_tryget(blkg))
601601
goto rl_use_root;
602602

603603
rcu_read_unlock();

0 commit comments

Comments
 (0)