diff options
author | Christoph Hellwig <[email protected]> | 2023-02-08 07:35:14 +0100 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2023-02-09 08:10:45 -0700 |
commit | c43332fe028c252a2a28e46be70a530f64fc3c9d (patch) | |
tree | a92d675fb0c4f51de51836f9665f0398b6fc8fe3 /lib/test_fortify/write_overflow-strlcpy-src.c | |
parent | a872818f484d69944c10be555941b2a73f6e1d4f (diff) |
blk-cgroup: delay calling blkcg_exit_disk until disk_release
While del_gendisk ensures there is no outstanding I/O on the queue,
it can't prevent block layer users from building new I/O.
This leads to a NULL ->root_blkg reference in bio_associate_blkg when
allocating a new bio on a shut down file system. Delay freeing the
blk-cgroup subsystems from del_gendisk until disk_release to make
sure the blkg and throttle information is still avaŃ–lable for bio
submitters, even if those bios will immediately fail.
This now can cause a case where disk_release is called on a disk
that hasn't been added. That's mostly harmless, except for a case
in blk_throttl_exit that now needs to check for a NULL ->td pointer.
Fixes: 178fa7d49815 ("blk-cgroup: delay blk-cgroup initialization until add_disk")
Reported-by: Ming Lei <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strlcpy-src.c')
0 files changed, 0 insertions, 0 deletions