Whamcloud - gitweb
Fix bug in e2fsck where we don't notice if a file with an extended
authorTheodore Ts'o <tytso@mit.edu>
Sun, 20 Mar 2005 21:57:10 +0000 (16:57 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 20 Mar 2005 21:57:10 +0000 (16:57 -0500)
attribute block is so big that i_blocks wraps to zero.

e2fsck/ChangeLog
e2fsck/pass1.c

index ecc3159..096f79e 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-20  Theodore Ts'o  <tytso@mit.edu>
+
+       * pass1.c (check_blocks): Move counting the extended attribute
+               block earlier so that we don't have to worry about
+               num_blocks wrapping for files which are too big.
+
 2006-02-05  Theodore Ts'o  <tytso@mit.edu>
 
        * Release of E2fsprogs 1.36
index 1e76ef9..ea61aa5 100644 (file)
@@ -1260,6 +1260,9 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
                }
        }
 
+       if (inode->i_file_acl && check_ext_attr(ctx, pctx, block_buf))
+               pb.num_blocks++;
+
        if (ext2fs_inode_has_valid_blocks(inode))
                pctx->errcode = ext2fs_block_iterate2(fs, ino,
                                       pb.is_dir ? BLOCK_FLAG_HOLE : 0,
@@ -1320,9 +1323,6 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
                }
        }
 
-       if (inode->i_file_acl && check_ext_attr(ctx, pctx, block_buf))
-               pb.num_blocks++;
-
        pb.num_blocks *= (fs->blocksize / 512);
 #if 0
        printf("inode %u, i_size = %lu, last_block = %lld, i_blocks=%lu, num_blocks = %lu\n",