mbox series

[v5,0/3] Ensure that a request queue is dissociated from the cgroup controller

Message ID 20180809145338.6160-1-bart.vanassche@wdc.com (mailing list archive)
Headers show
Series Ensure that a request queue is dissociated from the cgroup controller | expand

Message

Bart Van Assche Aug. 9, 2018, 2:53 p.m. UTC
Hello Jens,

Several block drivers call alloc_disk() followed by put_disk() if something
fails before device_add_disk() is called without calling blk_cleanup_queue().
Make sure that also for this scenario a request queue is dissociated from the
cgroup controller. This patch avoids that loading the parport_pc, paride and
pf drivers trigger a kernel crash. Since this patch series fixes a regression,
please consider these patches for kernel v4.19.

Thanks,

Bart.

Changes between v4 and v5:
- Instead of using #ifdef CONFIG_CGROUP / #endif, introduced a new function in
  the cgroups code.

Changes between v3 and v4:
- Added "Cc: stable" tags.

Changes between v2 and v3:
- Avoid code duplication by introducing a new helper function.

Changes between v1 and v2:
- Fixed the build for CONFIG_BLK_CGROUP=n.

Bart Van Assche (3):
  blkcg: Introduce blkg_root_lookup()
  block: Introduce blk_exit_queue()
  block: Ensure that a request queue is dissociated from the cgroup
    controller

 block/blk-core.c           | 54 +++++++++++++++++++++-----------------
 block/blk-sysfs.c          | 15 +++++++++++
 block/blk.h                |  1 +
 include/linux/blk-cgroup.h | 18 +++++++++++++
 4 files changed, 64 insertions(+), 24 deletions(-)

Comments

Jens Axboe Aug. 9, 2018, 3:13 p.m. UTC | #1
On 8/9/18 8:53 AM, Bart Van Assche wrote:
> Hello Jens,
> 
> Several block drivers call alloc_disk() followed by put_disk() if something
> fails before device_add_disk() is called without calling blk_cleanup_queue().
> Make sure that also for this scenario a request queue is dissociated from the
> cgroup controller. This patch avoids that loading the parport_pc, paride and
> pf drivers trigger a kernel crash. Since this patch series fixes a regression,
> please consider these patches for kernel v4.19.

Thanks, applied for 4.19.