public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Jan Kara <jack@suse.cz>, Sasha Levin <sashal@kernel.org>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 5.15 071/106] init: Initialize noop_backing_dev_info early
Date: Mon, 20 Jun 2022 14:51:30 +0200	[thread overview]
Message-ID: <20220620124726.503235304@linuxfoundation.org> (raw)
In-Reply-To: <20220620124724.380838401@linuxfoundation.org>

From: Jan Kara <jack@suse.cz>

[ Upstream commit 4bca7e80b6455772b4bf3f536dcbc19aac424d6a ]

noop_backing_dev_info is used by superblocks of various
pseudofilesystems such as kdevtmpfs. After commit 10e14073107d
("writeback: Fix inode->i_io_list not be protected by inode->i_lock
error") this broke because __mark_inode_dirty() started to access more
fields from noop_backing_dev_info and this led to crashes inside
locked_inode_to_wb_and_lock_list() called from __mark_inode_dirty().
Fix the problem by initializing noop_backing_dev_info before the
filesystems get mounted.

Fixes: 10e14073107d ("writeback: Fix inode->i_io_list not be protected by inode->i_lock error")
Reported-and-tested-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Reported-and-tested-by: Alexandru Elisei <alexandru.elisei@arm.com>
Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/base/init.c         |  2 ++
 include/linux/backing-dev.h |  2 ++
 mm/backing-dev.c            | 11 ++---------
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/base/init.c b/drivers/base/init.c
index a9f57c22fb9e..dab8aa5d2888 100644
--- a/drivers/base/init.c
+++ b/drivers/base/init.c
@@ -8,6 +8,7 @@
 #include <linux/init.h>
 #include <linux/memory.h>
 #include <linux/of.h>
+#include <linux/backing-dev.h>
 
 #include "base.h"
 
@@ -20,6 +21,7 @@
 void __init driver_init(void)
 {
 	/* These are the core pieces */
+	bdi_init(&noop_backing_dev_info);
 	devtmpfs_init();
 	devices_init();
 	buses_init();
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index ac7f231b8825..eed9a98eae0d 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -121,6 +121,8 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
 
 extern struct backing_dev_info noop_backing_dev_info;
 
+int bdi_init(struct backing_dev_info *bdi);
+
 /**
  * writeback_in_progress - determine whether there is writeback in progress
  * @wb: bdi_writeback of interest
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 02ff66f86358..02c9d5c7276e 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -229,20 +229,13 @@ static __init int bdi_class_init(void)
 }
 postcore_initcall(bdi_class_init);
 
-static int bdi_init(struct backing_dev_info *bdi);
-
 static int __init default_bdi_init(void)
 {
-	int err;
-
 	bdi_wq = alloc_workqueue("writeback", WQ_MEM_RECLAIM | WQ_UNBOUND |
 				 WQ_SYSFS, 0);
 	if (!bdi_wq)
 		return -ENOMEM;
-
-	err = bdi_init(&noop_backing_dev_info);
-
-	return err;
+	return 0;
 }
 subsys_initcall(default_bdi_init);
 
@@ -784,7 +777,7 @@ static void cgwb_remove_from_bdi_list(struct bdi_writeback *wb)
 
 #endif	/* CONFIG_CGROUP_WRITEBACK */
 
-static int bdi_init(struct backing_dev_info *bdi)
+int bdi_init(struct backing_dev_info *bdi)
 {
 	int ret;
 
-- 
2.35.1




  parent reply	other threads:[~2022-06-20 13:24 UTC|newest]

Thread overview: 121+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 12:50 [PATCH 5.15 000/106] 5.15.49-rc1 review Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 001/106] Revert "drm/amd/display: Fix DCN3 B0 DP Alt Mapping" Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 002/106] nfsd: Replace use of rwsem with errseq_t Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 003/106] arm64: dts: imx8mm-beacon: Enable RTS-CTS on UART3 Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 004/106] arm64: dts: imx8mn-beacon: " Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 005/106] powerpc/kasan: Silence KASAN warnings in __get_wchan() Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 006/106] ASoC: nau8822: Add operation for internal PLL off and on Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 007/106] drm/amd/display: Read Golden Settings Table from VBIOS Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 008/106] drm/amdkfd: Use mmget_not_zero in MMU notifier Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 009/106] dma-debug: make things less spammy under memory pressure Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 010/106] ASoC: cs42l52: Fix TLV scales for mixer controls Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 011/106] ASoC: cs35l36: Update digital volume TLV Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 012/106] ASoC: cs53l30: Correct number of volume levels on SX controls Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 013/106] ASoC: cs42l52: Correct TLV for Bypass Volume Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 014/106] ASoC: cs42l56: Correct typo in minimum level for SX volume controls Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 015/106] ASoC: cs42l51: Correct minimum value for SX volume control Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 016/106] drm/amdkfd: add pinned BOs to kfd_bo_list Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 017/106] ata: libata-core: fix NULL pointer deref in ata_host_alloc_pinfo() Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 018/106] quota: Prevent memory allocation recursion while holding dq_lock Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 019/106] ASoC: wm8962: Fix suspend while playing music Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 020/106] ASoC: es8328: Fix event generation for deemphasis control Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 021/106] ASoC: wm_adsp: Fix event generation for wm_adsp_fw_put() Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 022/106] Input: soc_button_array - also add Lenovo Yoga Tablet2 1051F to dmi_use_low_level_irq Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 023/106] scsi: vmw_pvscsi: Expand vcpuHint to 16 bits Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 024/106] scsi: lpfc: Resolve NULL ptr dereference after an ELS LOGO is aborted Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 025/106] scsi: lpfc: Fix port stuck in bypassed state after LIP in PT2PT topology Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 026/106] scsi: lpfc: Allow reduced polling rate for nvme_admin_async_event cmd completion Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 027/106] scsi: mpt3sas: Fix out-of-bounds compiler warning Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 028/106] scsi: ipr: Fix missing/incorrect resource cleanup in error case Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 029/106] scsi: pmcraid: Fix missing " Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 030/106] ALSA: hda/realtek - Add HW8326 support Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 031/106] virtio-mmio: fix missing put_device() when vm_cmdline_parent registration failed Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 032/106] nfc: nfcmrvl: Fix memory leak in nfcmrvl_play_deferred Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 033/106] ipv6: Fix signed integer overflow in l2tp_ip6_sendmsg Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 034/106] net: ethernet: mtk_eth_soc: fix misuse of mem alloc interface netdev[napi]_alloc_frag Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 035/106] gcc-12: disable -Wdangling-pointer warning for now Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 036/106] mellanox: mlx5: avoid uninitialized variable warning with gcc-12 Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 037/106] netfs: gcc-12: temporarily disable -Wattribute-warning for now Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 038/106] MIPS: Loongson-3: fix compile mips cpu_hwmon as module build error Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 039/106] random: credit cpu and bootloader seeds by default Greg Kroah-Hartman
2022-06-20 12:50 ` [PATCH 5.15 040/106] gpio: dwapb: Dont print error on -EPROBE_DEFER Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 041/106] platform/x86: gigabyte-wmi: Add Z690M AORUS ELITE AX DDR4 support Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 042/106] platform/x86: gigabyte-wmi: Add support for B450M DS3H-CF Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 043/106] platform/x86/intel: hid: Add Surface Go to VGBS allow list Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 044/106] staging: r8188eu: fix rtw_alloc_hwxmits error detection for now Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 045/106] staging: r8188eu: Use zeroing allocator in wpa_set_encryption() Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 046/106] staging: r8188eu: Fix warning of array overflow in ioctl_linux.c Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 047/106] pNFS: Dont keep retrying if the server replied NFS4ERR_LAYOUTUNAVAILABLE Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 048/106] pNFS: Avoid a live lock condition in pnfs_update_layout() Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 049/106] sunrpc: set cl_max_connect when cloning an rpc_clnt Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 050/106] clocksource: hyper-v: unexport __init-annotated hv_init_clocksource() Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 051/106] i40e: Fix adding ADQ filter to TC0 Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 052/106] i40e: Fix calculating the number of queue pairs Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 053/106] i40e: Fix call trace in setup_tx_descriptors Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 054/106] Drivers: hv: vmbus: Release cpu lock in error case Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 055/106] tty: goldfish: Fix free_irq() on remove Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 056/106] misc: atmel-ssc: Fix IRQ check in ssc_probe Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 057/106] io_uring: fix races with file table unregister Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 058/106] io_uring: fix races with buffer " Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 059/106] drm/i915/reset: Fix error_state_read ptr + offset use Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 060/106] net: hns3: split function hclge_update_port_base_vlan_cfg() Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 061/106] net: hns3: set port base vlan tbl_sta to false before removing old vlan Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 062/106] net: hns3: dont push link state to VF if unalive Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 063/106] net: hns3: fix tm port shapping of fibre port is incorrect after driver initialization Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 064/106] nvme: add device name to warning in uuid_show() Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 065/106] mlxsw: spectrum_cnt: Reorder counter pools Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 066/106] net: bgmac: Fix an erroneous kfree() in bgmac_remove() Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 067/106] net: ax25: Fix deadlock caused by skb_recv_datagram in ax25_recvmsg Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 068/106] arm64: ftrace: fix branch range checks Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 069/106] arm64: ftrace: consistently handle PLTs Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 070/106] certs/blacklist_hashes.c: fix const confusion in certs blacklist Greg Kroah-Hartman
2022-06-20 12:51 ` Greg Kroah-Hartman [this message]
2022-06-20 12:51 ` [PATCH 5.15 072/106] block: Fix handling of offline queues in blk_mq_alloc_request_hctx() Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 073/106] faddr2line: Fix overlapping text section failures, the sequel Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 074/106] i2c: npcm7xx: Add check for platform_driver_register Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 075/106] irqchip/gic/realview: Fix refcount leak in realview_gic_of_init Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 076/106] irqchip/gic-v3: Fix error handling in gic_populate_ppi_partitions Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 077/106] irqchip/gic-v3: Fix refcount leak " Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 078/106] irqchip/realtek-rtl: Fix refcount leak in map_interrupts Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 079/106] sched: Fix balance_push() vs __sched_setscheduler() Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 080/106] i2c: designware: Use standard optional ref clock implementation Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 081/106] mei: hbm: drop capability response on early shutdown Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 082/106] mei: me: add raptor lake point S DID Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 083/106] comedi: vmk80xx: fix expression for tx buffer size Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 084/106] crypto: memneq - move into lib/ Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 085/106] USB: serial: option: add support for Cinterion MV31 with new baseline Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 086/106] USB: serial: io_ti: add Agilent E5805A support Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 087/106] usb: dwc2: Fix memory leak in dwc2_hcd_init Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 088/106] usb: cdnsp: Fixed setting last_trb incorrectly Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 089/106] usb: gadget: lpc32xx_udc: Fix refcount leak in lpc32xx_udc_probe Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 090/106] usb: gadget: f_fs: change ep->status safe in ffs_epfile_io() Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 091/106] usb: gadget: f_fs: change ep->ep " Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 092/106] tty: n_gsm: Debug output allocation must use GFP_ATOMIC Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 093/106] serial: 8250: Store to lsr_save_flags after lsr read Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 094/106] bus: fsl-mc-bus: fix KASAN use-after-free in fsl_mc_bus_remove() Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 095/106] dm mirror log: round up region bitmap size to BITS_PER_LONG Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 096/106] drm/amd/display: Cap OLED brightness per max frame-average luminance Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 097/106] cfi: Fix __cfi_slowpath_diag RCU usage with cpuidle Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 098/106] ext4: fix super block checksum incorrect after mount Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 099/106] ext4: fix bug_on ext4_mb_use_inode_pa Greg Kroah-Hartman
2022-06-20 12:51 ` [PATCH 5.15 100/106] ext4: make variable "count" signed Greg Kroah-Hartman
2022-06-20 12:52 ` [PATCH 5.15 101/106] ext4: add reserved GDT blocks check Greg Kroah-Hartman
2022-06-20 12:52 ` [PATCH 5.15 102/106] KVM: arm64: Dont read a HW interrupt pending state in user context Greg Kroah-Hartman
2022-06-20 12:52 ` [PATCH 5.15 103/106] ALSA: hda/realtek: fix right sounds and mute/micmute LEDs for HP machine Greg Kroah-Hartman
2022-06-20 12:52 ` [PATCH 5.15 104/106] virtio-pci: Remove wrong address verification in vp_del_vqs() Greg Kroah-Hartman
2022-06-20 12:52 ` [PATCH 5.15 105/106] powerpc/book3e: get rid of #include <generated/compile.h> Greg Kroah-Hartman
2022-06-20 12:52 ` [PATCH 5.15 106/106] clk: imx8mp: fix usb_root_clk parent Greg Kroah-Hartman
2022-06-20 16:38 ` [PATCH 5.15 000/106] 5.15.49-rc1 review Fox Chen
2022-06-20 18:13 ` Florian Fainelli
2022-06-21  0:47 ` Guenter Roeck
2022-06-21  3:29 ` Bagas Sanjaya
2022-06-21  8:20 ` Ron Economos
2022-06-21  8:36 ` Naresh Kamboju
2022-06-21  8:55   ` Greg Kroah-Hartman
2022-06-21  9:45     ` Jason A. Donenfeld
2022-06-21 10:35       ` Greg Kroah-Hartman
2022-06-21 11:36         ` Naresh Kamboju
2022-06-21 15:12           ` Greg Kroah-Hartman
2022-06-21  9:40 ` Sudip Mukherjee
2022-06-21  9:59 ` Jon Hunter
2022-06-21 21:48 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220620124726.503235304@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexandru.elisei@arm.com \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox