1
0
Fork 0
alistair23-linux/include
Ming Lei 1db4909e76 blk-mq: not embed .mq_kobj and ctx->kobj into queue instance
Even though .mq_kobj, ctx->kobj and q->kobj share same lifetime
from block layer's view, actually they don't because userspace may
grab one kobject anytime via sysfs.

This patch fixes the issue by the following approach:

1) introduce 'struct blk_mq_ctxs' for holding .mq_kobj and managing
all ctxs

2) free all allocated ctxs and the 'blk_mq_ctxs' instance in release
handler of .mq_kobj

3) grab one ref of .mq_kobj before initializing each ctx->kobj, so that
.mq_kobj is always released after all ctxs are freed.

This patch fixes kernel panic issue during booting when DEBUG_KOBJECT_RELEASE
is enabled.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Cc: "jianchao.wang" <jianchao.w.wang@oracle.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-11-21 05:57:56 -07:00
..
acpi pci-v4.20-changes 2018-10-25 06:50:48 -07:00
asm-generic s390 updates for 4.20-rc2 2018-11-09 06:30:44 -06:00
clocksource
crypto KEYS: asym_tpm: extract key size & public key [ver #2] 2018-10-26 09:30:46 +01:00
drm drm, i915, amdgpu, bridge + core quirk 2018-11-02 10:58:20 -07:00
dt-bindings This time it looks like a quieter release cycle in the clk tree. I guess that's 2018-10-31 11:08:30 -07:00
keys KEYS: Move trusted.h to include/keys [ver #2] 2018-10-26 09:30:47 +01:00
kvm
linux blk-mq: not embed .mq_kobj and ctx->kobj into queue instance 2018-11-21 05:57:56 -07:00
math-emu
media media updates for v4.20-rc1 2018-10-31 10:53:29 -07:00
memory
misc
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf 2018-11-05 17:19:25 -08:00
pcmcia
ras
rdma First merge window pull request 2018-10-26 07:38:19 -07:00
scsi scsi: return blk_status_t from device handler ->prep_fn 2018-11-09 19:17:14 -07:00
soc ARM: SoC driver updates for 4.17 2018-10-29 15:16:01 -07:00
sound ASoC: Updates for v5.0/v4.20 2018-10-22 23:26:37 +02:00
target scsi: target/core: Remove the SCF_COMPARE_AND_WRITE_POST flag 2018-10-16 01:13:35 -04:00
trace kyber: fix wrong strlcpy() size in trace_kyber_latency() 2018-11-12 08:28:37 -07:00
uapi aio: Comment use of IOCB_FLAG_IOPRIO aio flag 2018-11-19 19:03:43 -07:00
video udlfb: handle unplug properly 2018-10-08 12:57:34 +02:00
xen CONFIG_XEN_PV breaks xen_create_contiguous_region on ARM 2018-11-02 17:18:34 +01:00