linux-stable/include
Anders Roxell db16eb5539 writeback: don't decrement wb->refcnt if !wb->bdi
[ Upstream commit 347a28b586 ]

This happened while running in qemu-system-aarch64, the AMBA PL011 UART
driver when enabling CONFIG_DEBUG_TEST_DRIVER_REMOVE.
arch_initcall(pl011_init) came before subsys_initcall(default_bdi_init),
devtmpfs' handle_remove() crashes because the reference count is a NULL
pointer only because wb->bdi hasn't been initialized yet.

Rework so that wb_put have an extra check if wb->bdi before decrement
wb->refcnt and also add a WARN_ON_ONCE to get a warning if it happens again
in other drivers.

Fixes: 52ebea749a ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks")
Co-developed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-01-26 09:38:32 +01:00
..
acpi ACPICA: OSL: Add support to exclude stdarg.h 2018-04-13 19:48:28 +02:00
asm-generic locking/qspinlock: Fix build for anonymous union in older GCC compilers 2018-12-21 14:11:34 +01:00
clocksource
crypto crypto: vmac - separate tfm and request context 2018-08-17 20:59:29 +02:00
drm drm: Add DP PSR2 sink enable bit 2018-08-03 07:55:26 +02:00
dt-bindings dt-bindings: clock: mediatek: add binding for fixed-factor clock axisel_d4 2018-04-24 09:34:14 +02:00
keys
kvm arm/arm64: KVM: Add PSCI version selection API 2018-05-09 09:50:19 +02:00
linux writeback: don't decrement wb->refcnt if !wb->bdi 2019-01-26 09:38:32 +01:00
math-emu
media media: v4l: event: Prevent freeing event subscriptions while accessed 2018-10-03 17:01:55 -07:00
memory
misc
net sock: Make sock->sk_stamp thread-safe 2019-01-09 16:16:41 +01:00
pcmcia
ras
rdma IB/core: Make testing MR flags for writability a static inline function 2018-08-15 18:14:43 +02:00
rxrpc
scsi scsi: sg: disable SET_FORCE_LOW_DMA 2018-01-23 19:57:04 +01:00
soc memory: tegra: Apply interrupts mask per SoC 2018-08-03 07:55:24 +02:00
sound ALSA: pcm: Fix interval evaluation with openmin/max 2018-12-13 09:20:28 +01:00
target target: Avoid early CMD_T_PRE_EXECUTE failures during ABORT_TASK 2018-01-17 09:38:54 +01:00
trace ext4: force inode writes when nfsd calls commit_metadata() 2019-01-09 16:16:44 +01:00
uapi Input: restore EV_ABS ABS_RESERVED 2019-01-13 10:03:48 +01:00
video udlfb: set optimal write delay 2018-09-09 20:01:25 +02:00
xen
Kbuild