Skip to content

block: fixes for always associate blkg

Dennis Zhou linux-block lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2blkcg: fix edge case for blk_get_rl() under memory pressureinclude/linux/blk-cgroup.h+1 -10 replies
2/2blkcg: reassociate bios when make_request() is called recursivelyblock/bio.c block/blk-core.c include/linux/bio.h+24 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchValdis Kletnieks
1/2
2/2T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] block: fixes for always associate blkg

Hi everyone,

It was reported in [1] that blk_get_rl() cleanup patch was causing a null pointer dereference. After some back and forth debugging with Valdis, it turns out I wasn't properly handling association with recursive calls to make_request().

Another issue was identified with the blk_get_rl() update as it is possible under certain circumstances that a blkg cannot be allocated when called in blk_get_rl(). This could result in the blkcg_root being returned. However, the blkcg_root is a special case where all blkgs share the request_queue's request_list.

The original series can be found at [2].

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/

This patchset contains the following 2 patches:
0001-blkcg-fix-edge-case-for-blk_get_rl-under-memory-pres.patch 0002-blkcg-reassociate-bios-when-make_request-is-called-r.patch

0001 addresses an edge case where a blkg cannot be created and can possibly return a blkg associated with the blkcg_root. 0002 fixes the stale association when make_request() is called recursively.

This patchset is on top of axboe#for-4.20/block bbc152825afc.

diffstats below:

Dennis Zhou (2):
blkcg: fix edge case for blk_get_rl() under memory pressure
blkcg: reassociate bios when make_request() is called recursively

 block/bio.c                | 20 ++++++++++++++++++++
 block/blk-core.c           |  1 +
 include/linux/bio.h        |  3 +++
 include/linux/blk-cgroup.h |  2 +-
 4 files changed, 25 insertions(+), 1 deletion(-)

Thanks,
Dennis