Linux kernel -stable discussions
 help / color / mirror / Atom feed
* Please backport 49f06cff50a4 ("block: skip sync_blockdev() on surprise removal in bdev_mark_dead()") to 6.6.y, 6.12.y, 6.18.y
@ 2026-07-14 21:20 Chao S
  2026-07-15  4:48 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Chao S @ 2026-07-14 21:20 UTC (permalink / raw)
  To: stable; +Cc: Weidong Zhu

Hi stable team,

Please consider the following mainline commit for the stable trees:

  commit 49f06cff50a4ccf3b7a1a662ceb892b3b21a527a
  Author: Chao Shi <coshi036@gmail.com>
  "block: skip sync_blockdev() on surprise removal in bdev_mark_dead()"

Why it should be applied:
On surprise removal (@surprise == true) the device is already gone, but the
bare block-device path in bdev_mark_dead() (no ->mark_dead holder op) calls
sync_blockdev() unconditionally. It can then hang forever in
folio_wait_writeback() waiting on writeback that can never complete. We hit
this via nvme_reset_work()'s "I/O queues lost" path
(nvme_mark_namespaces_dead -> blk_mark_disk_dead -> bdev_mark_dead(bdev, true)),
which wedges the reset worker and every task serialized behind it -- an
unrecoverable hung-task/DoS (multiple tasks blocked >120s, reproduced several
times under fuzzing). The fix simply skips the futile sync on surprise removal,
matching fs_bdev_mark_dead(); invalidate_bdev() still runs and orderly removal
is unchanged.

Affected versions:
  Fixes: d8530de5a6e8 ("block: call into the file system for bdev_mark_dead")
which first shipped in v6.6 (it dropped the pre-existing !surprise guard from
the bare-bdev path). So the bug is present in v6.6 through the fix.
v7.0+ already
carries the fix, and pre-6.6 trees still have the original guard, so
this is only
needed for the 6.6.y, 6.12.y and 6.18.y stable trees.

The change is a self-contained one-line guard (plus a comment) in
bdev_mark_dead()
and should cherry-pick cleanly onto all three; happy to send adjusted backports
if any tree conflicts.

Thanks,
Chao Shi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-18  2:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 21:20 Please backport 49f06cff50a4 ("block: skip sync_blockdev() on surprise removal in bdev_mark_dead()") to 6.6.y, 6.12.y, 6.18.y Chao S
2026-07-15  4:48 ` Greg KH
2026-07-15  7:46   ` Chao S
2026-07-16  7:34   ` [PATCH 6.6.y] block: skip sync_blockdev() on surprise removal in bdev_mark_dead() Chao Shi
2026-07-17  1:37     ` Sasha Levin
2026-07-18  2:54       ` Chao S

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox