]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Merge branch 'maint' into next
authorTheodore Ts'o <tytso@mit.edu>
Fri, 25 Jul 2014 12:38:39 +0000 (08:38 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 25 Jul 2014 12:38:39 +0000 (08:38 -0400)
Conflicts:
e2fsck/pass1.c

1  2 
e2fsck/e2fsck.h
e2fsck/pass1.c
e2fsck/pass1b.c
e2fsck/pass2.c
e2fsck/pass3.c
e2fsck/problem.c
e2fsck/problem.h
e2fsck/rehash.c
e2fsck/unix.c
lib/ext2fs/alloc.c

diff --cc e2fsck/e2fsck.h
Simple merge
diff --cc e2fsck/pass1.c
index 3f287b0943a7611da49a82a7d9bcaa9b8d942e85,87e6d341da7cb1c6fc246ac0c652a6102747eb7a..648c578d7471b6b7da3e015596903fd374c72f42
@@@ -762,8 -690,8 +762,9 @@@ void e2fsck_pass1(e2fsck_t ctx
        }
        block_buf = (char *) e2fsck_allocate_memory(ctx, fs->blocksize * 3,
                                                    "block interate buffer");
 -      e2fsck_use_inode_shortcuts(ctx, 1);
 +      if (EXT2_INODE_SIZE(fs->super) == EXT2_GOOD_OLD_INODE_SIZE)
 +              e2fsck_use_inode_shortcuts(ctx, 1);
+       e2fsck_intercept_block_allocations(ctx);
        old_op = ehandler_operation(_("opening inode scan"));
        pctx.errcode = ext2fs_open_inode_scan(fs, ctx->inode_buffer_blocks,
                                              &scan);
@@@ -2132,6 -1927,45 +2128,45 @@@ fix_problem_now
                        }
                        pb->fragmented = 1;
                }
 -              if (is_dir &&
+               /*
+                * If we notice a gap in the logical block mappings of an
+                * extent-mapped directory, offer to close the hole by
+                * moving the logical block down, otherwise we'll go mad in
+                * pass 3 allocating empty directory blocks to fill the hole.
+                */
++              if (try_repairs && is_dir &&
+                   pb->last_block + 1 < (e2_blkcnt_t)extent.e_lblk) {
+                       blk64_t new_lblk;
+                       new_lblk = pb->last_block + 1;
+                       if (EXT2FS_CLUSTER_RATIO(ctx->fs) > 1)
+                               new_lblk = ((new_lblk +
+                                            EXT2FS_CLUSTER_RATIO(ctx->fs)) &
+                                           EXT2FS_CLUSTER_MASK(ctx->fs)) |
+                                          (extent.e_lblk &
+                                           EXT2FS_CLUSTER_MASK(ctx->fs));
+                       pctx->blk = extent.e_lblk;
+                       pctx->blk2 = new_lblk;
+                       if (fix_problem(ctx, PR_1_COLLAPSE_DBLOCK, pctx)) {
+                               extent.e_lblk = new_lblk;
+                               pb->inode_modified = 1;
+                               pctx->errcode = ext2fs_extent_replace(ehandle,
+                                                               0, &extent);
+                               if (pctx->errcode) {
+                                       pctx->errcode = 0;
+                                       goto alloc_later;
+                               }
+                               pctx->errcode = ext2fs_extent_fix_parents(ehandle);
+                               if (pctx->errcode)
+                                       goto failed_add_dir_block;
+                               pctx->errcode = ext2fs_extent_goto(ehandle,
+                                                               extent.e_lblk);
+                               if (pctx->errcode)
+                                       goto failed_add_dir_block;
+                               last_lblk = extent.e_lblk + extent.e_len - 1;
+                       }
+               }
+ alloc_later:
                while (is_dir && (++pb->last_db_block <
                                  (e2_blkcnt_t) extent.e_lblk)) {
                        pctx->errcode = ext2fs_add_dir_block2(ctx->fs->dblist,
diff --cc e2fsck/pass1b.c
Simple merge
diff --cc e2fsck/pass2.c
Simple merge
diff --cc e2fsck/pass3.c
index 6f7f8559eaf17bca82914d30e5a55c40eb88c0b1,f9d4aae367ef98a01010b7bc3720591f04c83003..4fc390a82085681b74c2581eefb03eba001c2091
@@@ -828,9 -789,7 +807,8 @@@ errcode_t e2fsck_expand_directory(e2fsc
        es.err = 0;
        es.newblocks = 0;
        es.ctx = ctx;
 +      es.dir = dir;
  
-       before = ext2fs_free_blocks_count(fs->super);
        retval = ext2fs_block_iterate3(fs, dir, BLOCK_FLAG_APPEND,
                                       0, expand_dir_proc, &es);
  
index 18d80259b0bcc78f06a4ea669a5e749d4bb53686,837d1110903b47da206cf8974dcb0950a8d736d3..a1986c677aff3706bffe4503654df8ddf7e6a702
@@@ -1020,24 -966,12 +1020,29 @@@ static struct e2fsck_problem problem_ta
          N_("@i %i, end of extent exceeds allowed value\n\t(logical @b %c, physical @b %b, len %N)\n"),
          PROMPT_CLEAR, 0 },
  
 +      /* Inode has inline data, but superblock is missing INLINE_DATA feature. */
 +      { PR_1_INLINE_DATA_FEATURE,
 +        N_("@i %i has inline data, but @S is missing INLINE_DATA feature\n"),
 +        PROMPT_CLEAR, PR_PREEN_OK },
 +
 +      /* INLINE_DATA feature is set in a non-inline-data filesystem */
 +      { PR_1_INLINE_DATA_SET,
 +        N_("@i %i has INLINE_DATA_FL flag on @f without inline data support.\n"),
 +        PROMPT_CLEAR, 0 },
 +
 +      /*
 +       * Inode block conflicts with critical metadata, skipping
 +       * block checks
 +       */
 +      { PR_1_CRITICAL_METADATA_COLLISION,
 +        N_("@i %i block %b conflicts with critical metadata, skipping block checks.\n"),
 +        PROMPT_NONE, 0 },
  
+       /* Directory inode block <block> should be at block <otherblock> */
+       { PR_1_COLLAPSE_DBLOCK,
+         N_("@d @i %i @b %b should be at @b %c.  "),
+         PROMPT_FIX, 0 },
        /* Pass 1b errors */
  
        /* Pass 1B: Rescan for duplicate/bad blocks */
Simple merge
diff --cc e2fsck/rehash.c
Simple merge
diff --cc e2fsck/unix.c
Simple merge
Simple merge