Warn on block read bio completion timeout

Replace the unbounded wait_event() in block_read() with a 120
second timeout that issues a WARN if the bio completion never
arrives.  A lost completion would otherwise hang silently.

Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
Auke Kok
2026-04-15 13:49:03 -07:00
parent 0a80704c60
commit a46e70123d

View File

@@ -630,7 +630,9 @@ static struct block_private *block_read(struct super_block *sb, u64 blkno)
}
}
wait_event(binf->waitq, uptodate_or_error(bp));
while (!wait_event_timeout(binf->waitq, uptodate_or_error(bp), 120 * HZ))
WARN(1, "block read blkno %llu waiting for bio completion\n",
bp->bl.blkno);
if (test_bit(BLOCK_BIT_ERROR, &bp->bits))
ret = -EIO;
else