Whamcloud - gitweb
Merge branch 'maint' into next
authorTheodore Ts'o <tytso@mit.edu>
Fri, 25 Jul 2014 12:58:10 +0000 (08:58 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 25 Jul 2014 12:58:10 +0000 (08:58 -0400)
Conflicts:
e2fsck/pass1.c
e2fsck/problem.h

1  2 
e2fsck/pass1.c
e2fsck/problem.c
e2fsck/problem.h

diff --cc e2fsck/pass1.c
@@@ -1970,20 -1806,22 +1970,36 @@@ static void scan_extent_node(e2fsck_t c
                          (1 << (21 - ctx->fs->super->s_log_block_size))))
                        problem = PR_1_TOOBIG_DIR;
  
 -              if (is_dir && problem == 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);
 +                      }
 +              }
 +
+               /*
+                * Uninitialized blocks in a directory?  Clear the flag and
+                * we'll interpret the blocks later.
+                */
 -              if (problem) {
++              if (try_repairs && is_dir && problem == 0 &&
+                   (extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT) &&
+                   fix_problem(ctx, PR_1_UNINIT_DBLOCK, pctx)) {
+                       extent.e_flags &= ~EXT2_EXTENT_FLAGS_UNINIT;
+                       pb->inode_modified = 1;
+                       pctx->errcode = ext2fs_extent_replace(ehandle, 0,
+                                                             &extent);
+                       if (pctx->errcode)
+                               return;
++                      failed_csum = 0;
+               }
 +              if (try_repairs && problem) {
  report_problem:
                        pctx->blk = extent.e_pblk;
                        pctx->blk2 = extent.e_lblk;
Simple merge
Simple merge