From: Theodore Ts'o Date: Sun, 13 Oct 2013 02:26:28 +0000 (-0400) Subject: Merge branch 'maint' into next X-Git-Tag: v1.43-WIP-2015-05-18~382 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e337e7fad8d9f29ea6a7436b40361f3a1a17a6af;p=thirdparty%2Fe2fsprogs.git Merge branch 'maint' into next Conflicts: e2fsck/problem.c e2fsck/rehash.c e2fsck/super.c --- e337e7fad8d9f29ea6a7436b40361f3a1a17a6af diff --cc e2fsck/problem.c index b0a6e1935,66e2e05ba..897693a7f --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@@ -433,20 -433,11 +433,25 @@@ static struct e2fsck_problem problem_ta N_("ext2fs_check_desc: %m\n"), PROMPT_NONE, 0 }, + /* + * metadata_csum implies uninit_bg; both feature bits cannot + * be set simultaneously. + */ + { PR_0_META_AND_GDT_CSUM_SET, + N_("@S metadata_csum supersedes uninit_bg; both feature " + "bits cannot be set simultaneously."), + PROMPT_FIX, PR_PREEN_OK | PR_NO_OK}, + + /* Superblock has invalid MMP checksum. */ + { PR_0_MMP_CSUM_INVALID, + N_("@S MMP block checksum does not match MMP block. "), + PROMPT_FIX, PR_PREEN_OK | PR_NO_OK}, + + /* 64bit is set but extents is unset. */ + { PR_0_64BIT_WITHOUT_EXTENTS, + N_("@S 64bit filesystems needs extents to access the whole disk. "), + PROMPT_FIX, PR_PREEN_OK | PR_NO_OK}, + /* Pass 1 errors */ /* Pass 1: Checking inodes, blocks, and sizes */ diff --cc e2fsck/problem.h index fcdc1a137,4e7c9cd1f..ae1ed2621 --- a/e2fsck/problem.h +++ b/e2fsck/problem.h @@@ -249,16 -249,9 +249,19 @@@ struct problem_context /* Checking group descriptor failed */ #define PR_0_CHECK_DESC_FAILED 0x000045 + /* 64bit is set but extents are not set. */ + #define PR_0_64BIT_WITHOUT_EXTENTS 0x000048 + +/* + * metadata_csum supersedes uninit_bg; both feature bits cannot be set + * simultaneously. + */ +#define PR_0_META_AND_GDT_CSUM_SET 0x000046 + +/* Superblock has invalid MMP checksum. */ +#define PR_0_MMP_CSUM_INVALID 0x000047 + + /* * Pass 1 errors */ diff --cc e2fsck/rehash.c index c1c74c844,9dbdb3beb..6ef356862 --- a/e2fsck/rehash.c +++ b/e2fsck/rehash.c @@@ -684,8 -626,7 +684,8 @@@ struct write_dir_struct struct out_dir *outdir; errcode_t err; e2fsck_t ctx; - int cleared; + blk64_t cleared; + ext2_ino_t dir; }; /* diff --cc e2fsck/super.c index 16a1c23d7,352f16df8..5d470d8dc --- a/e2fsck/super.c +++ b/e2fsck/super.c @@@ -582,19 -582,17 +582,30 @@@ void check_super_block(e2fsck_t ctx } } + /* Are metadata_csum and uninit_bg both set? */ + if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super, + EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) && + EXT2_HAS_RO_COMPAT_FEATURE(fs->super, + EXT4_FEATURE_RO_COMPAT_GDT_CSUM) && + fix_problem(ctx, PR_0_META_AND_GDT_CSUM_SET, &pctx)) { + fs->super->s_feature_ro_compat &= + ~EXT4_FEATURE_RO_COMPAT_GDT_CSUM; + ext2fs_mark_super_dirty(fs); + for (i = 0; i < fs->group_desc_count; i++) + ext2fs_group_desc_csum_set(fs, i); + } + + /* Is 64bit set and extents unset? */ + if (EXT2_HAS_INCOMPAT_FEATURE(fs->super, + EXT4_FEATURE_INCOMPAT_64BIT) && + !EXT2_HAS_INCOMPAT_FEATURE(fs->super, + EXT3_FEATURE_INCOMPAT_EXTENTS) && + fix_problem(ctx, PR_0_64BIT_WITHOUT_EXTENTS, &pctx)) { + fs->super->s_feature_incompat |= + EXT3_FEATURE_INCOMPAT_EXTENTS; + ext2fs_mark_super_dirty(fs); + } + /* * Verify the group descriptors.... */ diff --cc lib/ext2fs/closefs.c index 157cbbeb5,3a804240c..db0563708 --- a/lib/ext2fs/closefs.c +++ b/lib/ext2fs/closefs.c @@@ -244,10 -244,9 +244,10 @@@ void ext2fs_update_dynamic_rev(ext2_fil } static errcode_t write_backup_super(ext2_filsys fs, dgrp_t group, - blk_t group_block, + blk64_t group_block, struct ext2_super_block *super_shadow) { + errcode_t retval; dgrp_t sgrp = group; if (sgrp > ((1 << 16) - 1)) diff --cc lib/ext2fs/link.c index f7150674f,2f4f54a35..e3ff4504c --- a/lib/ext2fs/link.c +++ b/lib/ext2fs/link.c @@@ -41,7 -41,9 +41,10 @@@ static int link_proc(struct ext2_dir_en struct ext2_dir_entry *next; unsigned int rec_len, min_rec_len, curr_rec_len; int ret = 0; + int csum_size = 0; + + if (ls->done) + return 0; rec_len = EXT2_DIR_REC_LEN(ls->namelen);