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 */
/* 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
*/
struct out_dir *outdir;
errcode_t err;
e2fsck_t ctx;
- int cleared;
+ blk64_t cleared;
+ ext2_ino_t dir;
};
/*
}
}
+ /* 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....
*/
}
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))
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);