block: skip sync_blockdev() on surprise removal in bdev_mark_dead()#872
block: skip sync_blockdev() on surprise removal in bdev_mark_dead()#872blktests-ci[bot] wants to merge 1 commit into
Conversation
|
Upstream branch: 6779b50 |
ea833a1 to
7af85d1
Compare
|
Upstream branch: 79bd2dd |
a5a25af to
db2b102
Compare
7af85d1 to
de94ac7
Compare
|
Upstream branch: eed108e |
db2b102 to
b270bd8
Compare
|
Upstream branch: eed108e |
b270bd8 to
0b2ce2a
Compare
de94ac7 to
86d8d37
Compare
|
Upstream branch: e8c2f9f |
0b2ce2a to
68cc3a4
Compare
|
Upstream branch: e8c2f9f |
68cc3a4 to
623e7b6
Compare
86d8d37 to
9805659
Compare
|
Upstream branch: eb3f4b7 |
623e7b6 to
f234b0c
Compare
9805659 to
3f4a345
Compare
|
Upstream branch: 8fde5d1 |
f234b0c to
5319ac4
Compare
3f4a345 to
c6dc343
Compare
|
Upstream branch: e43ffb6 |
5319ac4 to
3785d8d
Compare
c6dc343 to
fc36596
Compare
bdev_mark_dead()'s @surprise == true means the device is already gone. The filesystem callback fs_bdev_mark_dead() honours this and skips sync_filesystem(), but the bare block device path (no ->mark_dead op) lost its !surprise guard when the holder ->mark_dead callback was wired up (see Fixes), and now calls sync_blockdev() unconditionally, which can hang forever waiting on writeback that can no longer complete. syzkaller 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) -> sync_blockdev() blocks in folio_wait_writeback(), wedging the reset worker and every task waiting on it. Skip the sync on surprise removal, matching fs_bdev_mark_dead(); invalidate_bdev() still runs. Orderly removal (surprise == false) is unchanged. Fixes: d8530de ("block: call into the file system for bdev_mark_dead") Found by FuzzNvme(Syzkaller with FEMU fuzzing framework). Acked-by: Sungwoo Kim <iam@sung-woo.kim> Acked-by: Dave Tian <daveti@purdue.edu> Acked-by: Weidong Zhu <weizhu@fiu.edu> Signed-off-by: Chao Shi <coshi036@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Christian Brauner <brauner@kernel.org>
|
Upstream branch: ba3e43a |
3785d8d to
9a2b1cb
Compare
Pull request for series with
subject: block: skip sync_blockdev() on surprise removal in bdev_mark_dead()
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1099643