Whamcloud - gitweb
e2fsck: don't restart after a critical metadata collision in e2fsck -n mode
authorTheodore Ts'o <tytso@mit.edu>
Sun, 23 Jul 2017 04:08:18 +0000 (00:08 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 23 Jul 2017 04:44:25 +0000 (00:44 -0400)
If the file system isn't going to be changed, there's no point
restarting; it will just cause e2fsck to loop forever.

This problem was found using American Fuzzy Lop.

Reported-by: Adam Buchbinder <abuchbinder@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c

index c358eec..8044bee 100644 (file)
@@ -2718,7 +2718,8 @@ report_problem:
                                fix_problem(ctx,
                                            PR_1_CRITICAL_METADATA_COLLISION,
                                            pctx);
-                               ctx->flags |= E2F_FLAG_RESTART_LATER;
+                               if ((ctx->options & E2F_OPT_NO) == 0)
+                                       ctx->flags |= E2F_FLAG_RESTART_LATER;
                        }
                        pctx->errcode = ext2fs_extent_get(ehandle,
                                                  EXT2_EXTENT_DOWN, &extent);
@@ -3453,7 +3454,8 @@ static int process_block(ext2_filsys fs,
            ext2fs_test_block_bitmap2(ctx->block_metadata_map, blk)) {
                pctx->blk = blk;
                fix_problem(ctx, PR_1_CRITICAL_METADATA_COLLISION, pctx);
-               ctx->flags |= E2F_FLAG_RESTART_LATER;
+               if ((ctx->options & E2F_OPT_NO) == 0)
+                       ctx->flags |= E2F_FLAG_RESTART_LATER;
        }
 
        if (problem) {