Files
twx-linux/include/linux
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
..
2017-10-08 10:26:06 +02:00
2018-04-24 09:34:18 +02:00
2017-06-14 15:06:00 +02:00
2018-02-28 10:18:33 +01:00
2017-07-15 12:16:11 +02:00
2017-05-14 14:00:22 +02:00
2017-07-12 15:01:02 +02:00
2017-08-06 18:59:43 -07:00
2018-04-24 09:34:12 +02:00
2016-10-20 15:51:28 +11:00
2018-10-10 08:53:18 +02:00
2017-08-24 17:12:19 -07:00
2016-10-19 11:36:22 -06:00
2018-09-09 20:01:20 +02:00
2017-08-24 17:12:21 -07:00
2016-10-14 11:36:59 -07:00
2017-08-30 10:21:40 +02:00
2018-10-18 09:13:26 +02:00
2016-10-05 18:23:36 -04:00
2017-01-19 20:17:59 +01:00
2018-11-13 11:17:02 -08:00
2018-11-27 16:09:41 +01:00
2017-04-21 09:31:21 +02:00
2017-12-25 14:23:37 +01:00
2018-12-05 19:42:42 +01:00