From: Theodore Ts'o Date: Thu, 28 Jun 2018 15:10:58 +0000 (-0400) Subject: e2fsck: fix hang in readahead code if last block in fs is metadata X-Git-Tag: v1.44.3-rc2~11 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=73b69a891e5460771672cc28fbc685a329f07be4;p=tools%2Fe2fsprogs.git 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 --- 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;