diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2011-10-25 08:15:12 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-10-25 08:15:12 -0400 |
commit | a4e5d88b1b24827f4f6a3cba43228936a67d81ba (patch) | |
tree | 0f5b0309f290f5fc23478794c6f4adcd7c18896a /fs/ext4/inode.c | |
parent | 750c9c47a5f9daa88333ac435a1afe4d4b428230 (diff) |
ext4: update EOFBLOCKS flag on fallocate properly
EOFBLOCK_FL should be updated if called w/o FALLOCATE_FL_KEEP_SIZE
Currently it happens only if new extent was allocated.
TESTCASE:
fallocate test_file -n -l4096
fallocate test_file -l4096
Last fallocate cmd has updated size, but keept EOFBLOCK_FL set. And
fsck will complain about that.
Also remove ping pong in ext4_fallocate() in case of new extents,
where ext4_ext_map_blocks() clear EOFBLOCKS bit, and later
ext4_falloc_update_inode() restore it again.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index ff6aace0bb3c..87ec615f0fd6 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -477,9 +477,11 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode, | |||
477 | */ | 477 | */ |
478 | down_read((&EXT4_I(inode)->i_data_sem)); | 478 | down_read((&EXT4_I(inode)->i_data_sem)); |
479 | if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) { | 479 | if (ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) { |
480 | retval = ext4_ext_map_blocks(handle, inode, map, 0); | 480 | retval = ext4_ext_map_blocks(handle, inode, map, flags & |
481 | EXT4_GET_BLOCKS_KEEP_SIZE); | ||
481 | } else { | 482 | } else { |
482 | retval = ext4_ind_map_blocks(handle, inode, map, 0); | 483 | retval = ext4_ind_map_blocks(handle, inode, map, flags & |
484 | EXT4_GET_BLOCKS_KEEP_SIZE); | ||
483 | } | 485 | } |
484 | up_read((&EXT4_I(inode)->i_data_sem)); | 486 | up_read((&EXT4_I(inode)->i_data_sem)); |
485 | 487 | ||