From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
patches@lists.linux.dev, Wang Shuai <wangshuai12@xiaomi.com>,
Sheng Yong <shengyong1@xiaomi.com>,
Mikulas Patocka <mpatocka@redhat.com>
Subject: [PATCH 6.6 016/111] dm-bufio: fix sched in atomic context
Date: Tue, 22 Jul 2025 15:43:51 +0200 [thread overview]
Message-ID: <20250722134333.996771005@linuxfoundation.org> (raw)
In-Reply-To: <20250722134333.375479548@linuxfoundation.org>
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sheng Yong <shengyong1@xiaomi.com>
commit b1bf1a782fdf5c482215c0c661b5da98b8e75773 upstream.
If "try_verify_in_tasklet" is set for dm-verity, DM_BUFIO_CLIENT_NO_SLEEP
is enabled for dm-bufio. However, when bufio tries to evict buffers, there
is a chance to trigger scheduling in spin_lock_bh, the following warning
is hit:
BUG: sleeping function called from invalid context at drivers/md/dm-bufio.c:2745
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 123, name: kworker/2:2
preempt_count: 201, expected: 0
RCU nest depth: 0, expected: 0
4 locks held by kworker/2:2/123:
#0: ffff88800a2d1548 ((wq_completion)dm_bufio_cache){....}-{0:0}, at: process_one_work+0xe46/0x1970
#1: ffffc90000d97d20 ((work_completion)(&dm_bufio_replacement_work)){....}-{0:0}, at: process_one_work+0x763/0x1970
#2: ffffffff8555b528 (dm_bufio_clients_lock){....}-{3:3}, at: do_global_cleanup+0x1ce/0x710
#3: ffff88801d5820b8 (&c->spinlock){....}-{2:2}, at: do_global_cleanup+0x2a5/0x710
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 2 UID: 0 PID: 123 Comm: kworker/2:2 Not tainted 6.16.0-rc3-g90548c634bd0 #305 PREEMPT(voluntary)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
Workqueue: dm_bufio_cache do_global_cleanup
Call Trace:
<TASK>
dump_stack_lvl+0x53/0x70
__might_resched+0x360/0x4e0
do_global_cleanup+0x2f5/0x710
process_one_work+0x7db/0x1970
worker_thread+0x518/0xea0
kthread+0x359/0x690
ret_from_fork+0xf3/0x1b0
ret_from_fork_asm+0x1a/0x30
</TASK>
That can be reproduced by:
veritysetup format --data-block-size=4096 --hash-block-size=4096 /dev/vda /dev/vdb
SIZE=$(blockdev --getsz /dev/vda)
dmsetup create myverity -r --table "0 $SIZE verity 1 /dev/vda /dev/vdb 4096 4096 <data_blocks> 1 sha256 <root_hash> <salt> 1 try_verify_in_tasklet"
mount /dev/dm-0 /mnt -o ro
echo 102400 > /sys/module/dm_bufio/parameters/max_cache_size_bytes
[read files in /mnt]
Cc: stable@vger.kernel.org # v6.4+
Fixes: 450e8dee51aa ("dm bufio: improve concurrent IO performance")
Signed-off-by: Wang Shuai <wangshuai12@xiaomi.com>
Signed-off-by: Sheng Yong <shengyong1@xiaomi.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-bufio.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -2708,7 +2708,11 @@ static unsigned long __evict_many(struct
__make_buffer_clean(b);
__free_buffer_wake(b);
- cond_resched();
+ if (need_resched()) {
+ dm_bufio_unlock(c);
+ cond_resched();
+ dm_bufio_lock(c);
+ }
}
return count;
next prev parent reply other threads:[~2025-07-22 13:51 UTC|newest]
Thread overview: 128+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 13:43 [PATCH 6.6 000/111] 6.6.100-rc1 review Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 001/111] phy: tegra: xusb: Fix unbalanced regulator disable in UTMI PHY mode Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 002/111] phy: tegra: xusb: Decouple CYA_TRK_CODE_UPDATE_ON_IDLE from trk_hw_mode Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 003/111] phy: tegra: xusb: Disable periodic tracking on Tegra234 Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 004/111] USB: serial: option: add Telit Cinterion FE910C04 (ECM) composition Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 005/111] USB: serial: option: add Foxconn T99W640 Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 006/111] USB: serial: ftdi_sio: add support for NDI EMGUIDE GEMINI Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 007/111] usb: musb: fix gadget state on disconnect Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 008/111] usb: gadget: configfs: Fix OOB read on empty string write Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 009/111] i2c: stm32: fix the device used for the DMA map Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 010/111] thunderbolt: Fix wake on connect at runtime Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 011/111] thunderbolt: Fix bit masking in tb_dp_port_set_hops() Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 012/111] nvmem: imx-ocotp: fix MAC address byte length Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 013/111] Input: xpad - set correct controller type for Acer NGR200 Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 014/111] pch_uart: Fix dma_sync_sg_for_device() nents value Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 015/111] spi: Add check for 8-bit transfer with 8 IO mode support Greg Kroah-Hartman
2025-07-22 13:43 ` Greg Kroah-Hartman [this message]
2025-07-22 13:43 ` [PATCH 6.6 017/111] HID: core: ensure the allocated report buffer can contain the reserved report ID Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 018/111] HID: core: ensure __hid_request reserves the report ID as the first byte Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 019/111] HID: core: do not bypass hid_hw_raw_request Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 020/111] tracing/probes: Avoid using params uninitialized in parse_btf_arg() Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 021/111] tracing: Add down_write(trace_event_sem) when adding trace event Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 022/111] tracing/osnoise: Fix crash in timerlat_dump_stack() Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 023/111] drm/amdgpu/gfx8: reset compute ring wptr on the GPU on resume Greg Kroah-Hartman
2025-07-22 13:43 ` [PATCH 6.6 024/111] ALSA: hda/realtek: Add quirk for ASUS ROG Strix G712LWS Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 025/111] io_uring/poll: fix POLLERR handling Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 026/111] phonet/pep: Move call to pn_skb_get_dst_sockaddr() earlier in pep_sock_accept() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 027/111] net/mlx5: Update the list of the PCI supported devices Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 028/111] arm64: dts: imx8mp-venice-gw74xx: fix TPM SPI frequency Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 029/111] arm64: dts: freescale: imx8mm-verdin: Keep LDO5 always on Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 030/111] arm64: dts: rockchip: use cs-gpios for spi1 on ringneck Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 031/111] af_packet: fix the SO_SNDTIMEO constraint not effective on tpacked_snd() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 032/111] af_packet: fix soft lockup issue caused by tpacket_snd() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 033/111] dmaengine: nbpfaxi: Fix memory corruption in probe() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 034/111] isofs: Verify inode mode when loading from disk Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 035/111] memstick: core: Zero initialize id_reg in h_memstick_read_dev_id() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 036/111] mmc: bcm2835: Fix dma_unmap_sg() nents value Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 037/111] mmc: sdhci-pci: Quirk for broken command queuing on Intel GLK-based Positivo models Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 038/111] mmc: sdhci_am654: Workaround for Errata i2312 Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 039/111] net: libwx: remove duplicate page_pool_put_full_page() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 040/111] net: libwx: fix the using of Rx buffer DMA Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 041/111] net: libwx: properly reset Rx ring descriptor Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 042/111] pmdomain: governor: Consider CPU latency tolerance from pm_domain_cpu_gov Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 043/111] s390/bpf: Fix bpf_arch_text_poke() with new_addr == NULL again Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 044/111] smb: client: fix use-after-free in crypt_message when using async crypto Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 045/111] soc: aspeed: lpc-snoop: Cleanup resources in stack-order Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 046/111] soc: aspeed: lpc-snoop: Dont disable channels that arent enabled Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 047/111] iio: accel: fxls8962af: Fix use after free in fxls8962af_fifo_flush Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 048/111] iio: adc: max1363: Fix MAX1363_4X_CHANS/MAX1363_8X_CHANS[] Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 049/111] iio: adc: max1363: Reorder mode_list[] entries Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 050/111] iio: adc: stm32-adc: Fix race in installing chained IRQ handler Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 051/111] comedi: pcl812: Fix bit shift out of bounds Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 052/111] comedi: aio_iiro_16: " Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 053/111] comedi: das16m1: " Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 054/111] comedi: das6402: " Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 055/111] comedi: Fail COMEDI_INSNLIST ioctl if n_insns is too large Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 056/111] comedi: Fix some signed shift left operations Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 057/111] comedi: Fix use of uninitialized data in insn_rw_emulate_bits() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 058/111] comedi: Fix initialization of data for instructions that write to subdevice Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 059/111] soundwire: amd: fix for handling slave alerts after link is down Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 060/111] soundwire: amd: fix for clearing command status register Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 061/111] bpf: Reject %p% format string in bprintf-like helpers Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 062/111] cachefiles: Fix the incorrect return value in __cachefiles_write() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 063/111] net: emaclite: Fix missing pointer increment in aligned_read() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 064/111] block: fix kobject leak in blk_unregister_queue Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 065/111] net/sched: sch_qfq: Fix race condition on qfq_aggregate Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 066/111] rpl: Fix use-after-free in rpl_do_srh_inline() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 067/111] smb: client: fix use-after-free in cifs_oplock_break Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 068/111] nvme: fix inconsistent RCU list manipulation in nvme_ns_add_to_ctrl_list() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 069/111] net: phy: Dont register LEDs for genphy Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 070/111] nvme: fix misaccounting of nvme-mpath inflight I/O Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 071/111] wifi: cfg80211: remove scan request n_channels counted_by Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 072/111] selftests: net: increase inter-packet timeout in udpgro.sh Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 073/111] hwmon: (corsair-cpro) Validate the size of the received input buffer Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 074/111] ice: add NULL check in eswitch lag check Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 075/111] usb: net: sierra: check for no status endpoint Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 076/111] Bluetooth: Fix null-ptr-deref in l2cap_sock_resume_cb() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 077/111] Bluetooth: hci_sync: fix connectable extended advertising when using static random address Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 078/111] Bluetooth: SMP: If an unallowed command is received consider it a failure Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 079/111] Bluetooth: SMP: Fix using HCI_ERROR_REMOTE_USER_TERM on timeout Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 080/111] Bluetooth: btusb: QCA: Fix downloading wrong NVM for WCN6855 GF variant without board ID Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 081/111] net/mlx5: Correctly set gso_size when LRO is used Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 082/111] ipv6: mcast: Delay put pmc->idev in mld_del_delrec() Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 083/111] netfilter: nf_conntrack: fix crash due to removal of uninitialised entry Greg Kroah-Hartman
2025-07-22 13:44 ` [PATCH 6.6 084/111] Bluetooth: L2CAP: Fix attempting to adjust outgoing MTU Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 085/111] hv_netvsc: Set VF priv_flags to IFF_NO_ADDRCONF before open to prevent IPv6 addrconf Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 086/111] tls: always refresh the queue when reading sock Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 087/111] net: vlan: fix VLAN 0 refcount imbalance of toggling filtering during runtime Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 088/111] net: bridge: Do not offload IGMP/MLD messages Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 089/111] net/sched: Return NULL when htb_lookup_leaf encounters an empty rbtree Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 090/111] rxrpc: Fix recv-recv race of completed call Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 091/111] rxrpc: Fix transmission of an abort in response to an abort Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 092/111] Revert "cgroup_freezer: cgroup_freezing: Check if not frozen" Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 093/111] sched: Change nr_uninterruptible type to unsigned long Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 094/111] ipv6: make addrconf_wq single threaded Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 095/111] clone_private_mnt(): make sure that caller has CAP_SYS_ADMIN in the right userns Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 096/111] arm64: Filter out SME hwcaps when FEAT_SME isnt implemented Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 097/111] usb: hub: fix detection of high tier USB3 devices behind suspended hubs Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 098/111] usb: hub: Fix flushing and scheduling of delayed work that tunes runtime pm Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 099/111] usb: hub: Fix flushing of delayed work used for post resume purposes Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 100/111] usb: hub: Dont try to recover devices lost during warm reset Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 101/111] usb: dwc3: qcom: Dont leave BCR asserted Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 102/111] i2c: omap: Add support for setting mux Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 103/111] i2c: omap: Fix an error handling path in omap_i2c_probe() Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 104/111] i2c: omap: Handle omap_i2c_init() errors " Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 105/111] regulator: pwm-regulator: Calculate the output voltage for disabled PWMs Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 106/111] regulator: pwm-regulator: Manage boot-on with disabled PWM channels Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 107/111] ASoC: fsl_sai: Force a software reset when starting in consumer mode Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 108/111] Revert "selftests/bpf: adjust dummy_st_ops_success to detect additional error" Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 109/111] Revert "selftests/bpf: dummy_st_ops should reject 0 for non-nullable params" Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 110/111] i2c: omap: fix deprecated of_property_read_bool() use Greg Kroah-Hartman
2025-07-22 13:45 ` [PATCH 6.6 111/111] nvmem: layouts: u-boot-env: remove crc32 endianness conversion Greg Kroah-Hartman
2025-07-22 16:29 ` [PATCH 6.6 000/111] 6.6.100-rc1 review Brett A C Sheffield
2025-07-23 6:33 ` [PATCH 6.6 111/111] nvmem: layouts: u-boot-env: remove crc32 endianness conversion Michael Pratt
2025-07-23 6:41 ` Greg Kroah-Hartman
2025-07-23 10:54 ` Michael Pratt
2025-07-23 11:38 ` Greg Kroah-Hartman
2025-07-22 18:58 ` [PATCH 6.6 000/111] 6.6.100-rc1 review Florian Fainelli
2025-07-22 21:24 ` Shuah Khan
2025-07-22 22:13 ` Miguel Ojeda
2025-07-23 6:09 ` Peter Schneider
2025-07-23 11:02 ` Mark Brown
2025-07-23 11:34 ` Harshit Mogalapalli
2025-07-23 11:34 ` Jon Hunter
2025-07-23 13:15 ` Naresh Kamboju
2025-07-24 3:46 ` Hardik Garg
2025-07-24 3:48 ` Ron Economos
2025-07-30 16:59 ` 6.6.101-rc1-g1a25720a319a review Brett A C Sheffield
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=20250722134333.996771005@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=mpatocka@redhat.com \
--cc=patches@lists.linux.dev \
--cc=shengyong1@xiaomi.com \
--cc=stable@vger.kernel.org \
--cc=wangshuai12@xiaomi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.