Whamcloud - gitweb
e2fsck: Set i_blocks_hi when correcting the i_blocks field in pass #1
authorTheodore Ts'o <tytso@mit.edu>
Sat, 25 Sep 2010 02:57:06 +0000 (22:57 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 25 Sep 2010 02:57:06 +0000 (22:57 -0400)
For file systems with 64-bit block numbers, we need to make sure we
correct the i_blocks_hi field as well as the i_blocks field when
setting it to the correct value.

Thanks to Justin Maggard for pointing this out.

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

index 93763cd..67dd986 100644 (file)
@@ -2036,7 +2036,7 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
                pctx->num = pb.num_blocks;
                if (fix_problem(ctx, PR_1_BAD_I_BLOCKS, pctx)) {
                        inode->i_blocks = pb.num_blocks;
-                       inode->osd2.linux2.l_i_blocks_hi = 0;
+                       inode->osd2.linux2.l_i_blocks_hi = pb.num_blocks >> 32;
                        dirty_inode++;
                }
                pctx->num = 0;