From: Theodore Ts'o Date: Thu, 13 Mar 2008 14:53:26 +0000 (-0400) Subject: Merge branch 'maint' X-Git-Tag: v1.41-WIP-0427~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a040a99b6cc4bf9f10d39747ca6947f0462a2eb2;p=thirdparty%2Fe2fsprogs.git Merge branch 'maint' Conflicts: lib/ext2fs/ext2_err.et.in --- a040a99b6cc4bf9f10d39747ca6947f0462a2eb2 diff --cc e2fsck/pass1.c index e2143612b,839f099de..c598205ee --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@@ -1722,11 -1530,42 +1722,31 @@@ static void check_blocks(e2fsck_t ctx, ctx->fs_fragmented++; if (pb.clear) { - inode->i_links_count = 0; - ext2fs_icount_store(ctx->inode_link_info, ino, 0); - inode->i_dtime = ctx->now; - dirty_inode++; - ext2fs_unmark_inode_bitmap(ctx->inode_dir_map, ino); - ext2fs_unmark_inode_bitmap(ctx->inode_reg_map, ino); - ext2fs_unmark_inode_bitmap(ctx->inode_used_map, ino); - /* - * The inode was probably partially accounted for - * before processing was aborted, so we need to - * restart the pass 1 scan. - */ - ctx->flags |= E2F_FLAG_RESTART; - goto out; + e2fsck_clear_inode(ctx, ino, inode, E2F_FLAG_RESTART, + "check_blocks"); + return; } + if (pb.is_dir) { + while (1) { + struct ext2_db_entry *entry; + + if (ext2fs_dblist_get_last(fs->dblist, &entry) || + (entry->ino != ino) || + (entry->blk != 0) || + (entry->blockcnt == 0)) + break; + /* printf("Dropping ino %lu blk %lu blockcnt %d\n", + entry->ino, entry->blk, entry->blockcnt); */ + ext2fs_dblist_drop_last(fs->dblist); + if (ext2fs_dblist_get_last(fs->dblist, &entry) || + (entry->ino != ino)) + pb.last_block--; + else + pb.last_block = entry->blockcnt; + } + } + if (inode->i_flags & EXT2_INDEX_FL) { if (handle_htree(ctx, pctx, ino, inode, block_buf)) { inode->i_flags &= ~EXT2_INDEX_FL; diff --cc lib/ext2fs/ext2_err.et.in index 72331de5f,7451242e2..9047a8ffd --- a/lib/ext2fs/ext2_err.et.in +++ b/lib/ext2fs/ext2_err.et.in @@@ -326,81 -326,8 +326,85 @@@ ec EXT2_ET_TDB_ERR_NOEXIST ec EXT2_ET_TDB_ERR_RDONLY, "TDB: Write not permitted" + ec EXT2_ET_DBLIST_EMPTY, + "Ext2fs directory block list is empty" + - end +ec EXT2_ET_RO_BLOCK_ITERATE, + "Attempt to modify a block mapping via a read-only block iterator" + +ec EXT2_ET_MAGIC_EXTENT_PATH, + "Wrong magic number for ext4 extent saved path" + +ec EXT2_ET_MAGIC_RESERVED_10, + "Wrong magic number --- RESERVED_10" + +ec EXT2_ET_MAGIC_RESERVED_11, + "Wrong magic number --- RESERVED_11" + +ec EXT2_ET_MAGIC_RESERVED_12, + "Wrong magic number --- RESERVED_12" + +ec EXT2_ET_MAGIC_RESERVED_13, + "Wrong magic number --- RESERVED_13" + +ec EXT2_ET_MAGIC_RESERVED_14, + "Wrong magic number --- RESERVED_14" + +ec EXT2_ET_MAGIC_RESERVED_15, + "Wrong magic number --- RESERVED_15" + +ec EXT2_ET_MAGIC_RESERVED_16, + "Wrong magic number --- RESERVED_16" + +ec EXT2_ET_MAGIC_RESERVED_17, + "Wrong magic number --- RESERVED_17" + +ec EXT2_ET_MAGIC_RESERVED_18, + "Wrong magic number --- RESERVED_18" + +ec EXT2_ET_MAGIC_RESERVED_19, + "Wrong magic number --- RESERVED_19" + +ec EXT2_ET_EXTENT_HEADER_BAD, + "Corrupt extent header" + +ec EXT2_ET_EXTENT_INDEX_BAD, + "Corrupt extent index" +ec EXT2_ET_EXTENT_LEAF_BAD, + "Corrupt extent" + +ec EXT2_ET_EXTENT_NO_SPACE, + "No free space in extent map" + +ec EXT2_ET_INODE_NOT_EXTENT, + "Inode does not use extents" + +ec EXT2_ET_EXTENT_NO_NEXT, + "No 'next' extent" + +ec EXT2_ET_EXTENT_NO_PREV, + "No 'previous' extent" + +ec EXT2_ET_EXTENT_NO_UP, + "No 'up' extent" + +ec EXT2_ET_EXTENT_NO_DOWN, + "No 'down' extent" + +ec EXT2_ET_NO_CURRENT_NODE, + "No current node" + +ec EXT2_ET_OP_NOT_SUPPORTED, + "Ext2fs operation not supported" + +ec EXT2_ET_CANT_INSERT_EXTENT, + "No room to insert extent in node" + +ec EXT2_ET_EXTENT_NOT_FOUND, + "Extent not found" + +ec EXT2_ET_EXTENT_NOT_SUPPORTED, + "Operation not supported for inodes containing extents" ++ + end