Whamcloud - gitweb
debugfs: teach logdump the -n <num_trans> option
[tools/e2fsprogs.git] / e2fsck / readahead.c
index 4429a37..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;
 
@@ -242,7 +244,7 @@ unsigned long long e2fsck_guess_readahead(ext2_filsys fs)
         * worth of inode table blocks seems to yield the largest reductions
         * in e2fsck runtime.
         */
-       guess = 2 * fs->blocksize * fs->inode_blocks_per_group;
+       guess = 2ULL * fs->blocksize * fs->inode_blocks_per_group;
 
        /* Disable RA if it'd use more 1/50th of RAM. */
        if (get_memory_size() > (guess * 50))