]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2fsck: Fix max size calculation for extent files
authorTheodore Ts'o <tytso@mit.edu>
Sun, 17 Aug 2008 13:41:38 +0000 (09:41 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 17 Aug 2008 13:41:38 +0000 (09:41 -0400)
A misunderstanding C's precedence rules and the meaning of
s_log_block_size meant that we were capping the maximum size of
extent-based files at 8GB instead of the 64TB that it should be for
filesystems with 4k block sizes.

Addresses-Kernel-Bugzilla: #11341

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass1.c

index a7a2b101d762907eaf0a038f4df52fb35d18bdf2..268c2a398d46874fd21890a9a093dc1a2b6cc41b 100644 (file)
@@ -1926,13 +1926,15 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
                        /* too big for a direct/indirect-mapped file */
                        bad_size = 4;
                else if ((extent_fs && (inode->i_flags & EXT4_EXTENTS_FL)) &&
-                        size > (1LL << (32 + fs->super->s_log_block_size) - 1))
+                        size >
+                        ((1LL << (32 + EXT2_BLOCK_SIZE_BITS(fs->super))) - 1))
                        /* too big for an extent-based file - 32bit ee_block */
                        bad_size = 6;
        }
        /* i_size for symlinks is checked elsewhere */
        if (bad_size && !LINUX_S_ISLNK(inode->i_mode)) {
                pctx->num = (pb.last_block+1) * fs->blocksize;
+               pctx->group = bad_size;
                if (fix_problem(ctx, PR_1_BAD_I_SIZE, pctx)) {
                        inode->i_size = pctx->num;
                        if (!LINUX_S_ISDIR(inode->i_mode))