]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: restart the full e2fsck run if the bad block inode is invalidate
authorTheodore Ts'o <tytso@mit.edu>
Fri, 17 Jan 2020 15:51:16 +0000 (10:51 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 17 Jan 2020 15:51:16 +0000 (10:51 -0500)
Previously, we just cleared the bad block list and restarted the inode
scan, but we didn't do a full reset of all of e2fsck's state.  When
code handling this case; we didn't have the framework to do a
restarted run.  Now that we do, we can simply the code and make it
more correct.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c
tests/f_bb_in_bb/expect.1

index ed85431daf63bf0d032188ed29acbf80f4094779..4de9ca6533aef4d727086f0e6c665e829dc9b4bf 100644 (file)
@@ -1382,17 +1382,9 @@ void e2fsck_pass1(e2fsck_t ctx)
                                        fix_problem(ctx, PR_1_ISCAN_ERROR,
                                                    &pctx);
                                        ctx->flags |= E2F_FLAG_ABORT;
-                                       goto endit;
-                               }
-                               err = ext2fs_inode_scan_goto_blockgroup(scan,
-                                                                       0);
-                               if (err) {
-                                       fix_problem(ctx, PR_1_ISCAN_ERROR,
-                                                   &pctx);
-                                       ctx->flags |= E2F_FLAG_ABORT;
-                                       goto endit;
-                               }
-                               continue;
+                               } else
+                                       ctx->flags |= E2F_FLAG_RESTART;
+                               goto endit;
                        }
                        if (!ctx->inode_bb_map)
                                alloc_bb_map(ctx);
index 1d719e51fceb79335f2112e88cd537a9e17b405c..1bd697ec9efd088bd847ac118424f75304fc20c5 100644 (file)
@@ -1,6 +1,8 @@
 Pass 1: Checking inodes, blocks, and sizes
 Bad block list says the bad block list inode is bad.  Clear inode? yes
 
+Restarting e2fsck from the beginning...
+Pass 1: Checking inodes, blocks, and sizes
 Pass 2: Checking directory structure
 Pass 3: Checking directory connectivity
 Pass 4: Checking reference counts