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 <auke.kok@versity.com>
This commit is contained in:
Auke Kok
2026-03-06 10:35:09 -08:00
parent a62708ac19
commit b43b8e9559

View File

@@ -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));