From b43b8e95590ac6bf6cd0e1d30ce38b816c00a23d Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Fri, 6 Mar 2026 10:35:09 -0800 Subject: [PATCH] Set BLOCK_BIT_ERROR on bio submit failure. When block_submit_bio() fails, set BLOCK_BIT_ERROR so that waiters in wait_event(uptodate_or_error) will wake up rather than waiting indefinitely for a completion. Signed-off-by: Auke Kok --- kmod/src/block.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kmod/src/block.c b/kmod/src/block.c index 463e1b01..8602f18c 100644 --- a/kmod/src/block.c +++ b/kmod/src/block.c @@ -624,8 +624,10 @@ static struct block_private *block_read(struct super_block *sb, u64 blkno) if (!test_bit(BLOCK_BIT_UPTODATE, &bp->bits) && test_and_clear_bit(BLOCK_BIT_NEW, &bp->bits)) { ret = block_submit_bio(sb, bp, REQ_OP_READ); - if (ret < 0) + if (ret < 0) { + set_bit(BLOCK_BIT_ERROR, &bp->bits); goto out; + } } wait_event(binf->waitq, uptodate_or_error(bp));