From: Darrick J. Wong Date: Sat, 12 Oct 2013 01:20:36 +0000 (-0400) Subject: e2fsck: enable extents on all 64bit filesystems X-Git-Tag: v1.42.9~128 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=27b2297d5726623c2d119c671a0e1778aae6010a;p=tools%2Fe2fsprogs.git e2fsck: enable extents on all 64bit filesystems Since it's impossible to address all blocks of a 64bit filesystem without extents, have e2fsck turn on the feature if it finds (64bit && !extents). Signed-off-by: Darrick J. Wong Signed-off-by: "Theodore Ts'o" --- diff --git a/e2fsck/problem.c b/e2fsck/problem.c index 6d03765..66e2e05 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -433,6 +433,11 @@ static struct e2fsck_problem problem_table[] = { N_("ext2fs_check_desc: %m\n"), PROMPT_NONE, 0 }, + /* 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 --git a/e2fsck/problem.h b/e2fsck/problem.h index b578678..4e7c9cd 100644 --- a/e2fsck/problem.h +++ b/e2fsck/problem.h @@ -249,6 +249,9 @@ 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 + /* * Pass 1 errors */ diff --git a/e2fsck/super.c b/e2fsck/super.c index 07f5fe5..352f16d 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -582,6 +582,17 @@ void check_super_block(e2fsck_t ctx) } } + /* 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.... */