Whamcloud - gitweb
e2fsck: fix hang in readahead code if last block in fs is metadata
authorTheodore Ts'o <tytso@mit.edu>
Thu, 28 Jun 2018 15:10:58 +0000 (11:10 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 28 Jun 2018 15:10:58 +0000 (11:10 -0400)
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 <tytso@mit.edu>
e2fsck/readahead.c

index a860f2b..38d4ec4 100644 (file)
@@ -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;