Whamcloud - gitweb
e2fsck: don't complain about i_size for known blocks past EOF
authorEric Sandeen <sandeen@redhat.com>
Wed, 24 Feb 2010 16:24:37 +0000 (11:24 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 24 Feb 2010 16:24:37 +0000 (11:24 -0500)
This is the userspace side of Jiaying's EOFBLOCKS patch.  With
Aneesh's patches for .33, Jiaying's patch, and this one, xfstests
013/fsstress (even with direct IO enabled) has held up through many
runs.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass1.c
lib/ext2fs/ext2_fs.h

index 695abe4..c39d837 100644 (file)
@@ -1990,7 +1990,8 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
                    /* allow allocated blocks to end of PAGE_SIZE */
                    (size < (__u64)pb.last_block * fs->blocksize) &&
                    (pb.last_block / blkpg * blkpg != pb.last_block ||
-                    size < (__u64)(pb.last_block & ~(blkpg-1)) *fs->blocksize))
+                    size < (__u64)(pb.last_block & ~(blkpg-1)) *fs->blocksize) &&
+                   !(inode->i_flags & EXT4_EOFBLOCKS_FL))
                        bad_size = 3;
                else if (!(extent_fs && (inode->i_flags & EXT4_EXTENTS_FL)) &&
                         size > ext2_max_sizes[fs->super->s_log_block_size])
index 6c3fb15..b022d48 100644 (file)
@@ -273,10 +273,11 @@ struct ext2_dx_countlimit {
 #define EXT2_TOPDIR_FL                 0x00020000 /* Top of directory hierarchies*/
 #define EXT4_HUGE_FILE_FL               0x00040000 /* Set to each huge file */
 #define EXT4_EXTENTS_FL                0x00080000 /* Inode uses extents */
+#define EXT4_EOFBLOCKS_FL              0x00400000 /* Blocks allocated beyond EOF */
 #define EXT2_RESERVED_FL               0x80000000 /* reserved for ext2 lib */
 
-#define EXT2_FL_USER_VISIBLE           0x000BDFFF /* User visible flags */
-#define EXT2_FL_USER_MODIFIABLE                0x000080FF /* User modifiable flags */
+#define EXT2_FL_USER_VISIBLE           0x004BDFFF /* User visible flags */
+#define EXT2_FL_USER_MODIFIABLE                0x004B80FF /* User modifiable flags */
 
 /*
  * ioctl commands