From 73b69a891e5460771672cc28fbc685a329f07be4 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 28 Jun 2018 11:10:58 -0400 Subject: [PATCH] e2fsck: fix hang in readahead code if last block in fs is metadata If the last block the file system is metadata (very rare, but it can happen, especially if e2fsck needs to relocate a bitmap block), e2fsck will hang while trying to do readahead. This problem was reported by Adam Buchbinder. Signed-off-by: Theodore Ts'o --- e2fsck/readahead.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/e2fsck/readahead.c b/e2fsck/readahead.c index a860f2b..38d4ec4 100644 --- a/e2fsck/readahead.c +++ b/e2fsck/readahead.c @@ -98,6 +98,8 @@ static errcode_t e2fsck_readahead_bitmap(ext2_filsys fs, if (err == ENOENT) { out = end; err = 0; + if (out == start) + break; } else if (err) break; -- 1.8.3.1