Whamcloud - gitweb
e2fsck: fix merge error in "clear uninit flag on directory extents"
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 26 Jul 2014 20:03:10 +0000 (16:03 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 26 Jul 2014 20:03:10 +0000 (16:03 -0400)
In the original patch (against -next), the hunk to fix uninit dirs was
just prior to the hunk labelled "Corrupt but passes checks?".  The
hunks are ordered this way so that if e2fsck obtains permission to fix
a failed-csum extent (which in turn fixes the checksum), it will not
subsequently ask to (re)fix the checksum.

Due to a merge error the hunk moved to the wrong place, so put it
back.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c

index e1e8662..8d73dce 100644 (file)
@@ -2008,19 +2008,6 @@ static void scan_extent_node(e2fsck_t ctx, struct problem_context *pctx,
                          (1 << (21 - ctx->fs->super->s_log_block_size))))
                        problem = PR_1_TOOBIG_DIR;
 
-               /* Corrupt but passes checks?  Ask to fix checksum. */
-               if (try_repairs && failed_csum) {
-                       pctx->blk = extent.e_pblk;
-                       pctx->blk2 = extent.e_lblk;
-                       pctx->num = extent.e_len;
-                       problem = 0;
-                       if (fix_problem(ctx, PR_1_EXTENT_ONLY_CSUM_INVALID,
-                                       pctx)) {
-                               pb->inode_modified = 1;
-                               ext2fs_extent_replace(ehandle, 0, &extent);
-                       }
-               }
-
                /*
                 * Uninitialized blocks in a directory?  Clear the flag and
                 * we'll interpret the blocks later.
@@ -2037,6 +2024,19 @@ static void scan_extent_node(e2fsck_t ctx, struct problem_context *pctx,
                        failed_csum = 0;
                }
 
+               /* Corrupt but passes checks?  Ask to fix checksum. */
+               if (try_repairs && failed_csum) {
+                       pctx->blk = extent.e_pblk;
+                       pctx->blk2 = extent.e_lblk;
+                       pctx->num = extent.e_len;
+                       problem = 0;
+                       if (fix_problem(ctx, PR_1_EXTENT_ONLY_CSUM_INVALID,
+                                       pctx)) {
+                               pb->inode_modified = 1;
+                               ext2fs_extent_replace(ehandle, 0, &extent);
+                       }
+               }
+
                if (try_repairs && problem) {
 report_problem:
                        pctx->blk = extent.e_pblk;