aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2012-03-21 21:47:55 -0400
committerTheodore Ts'o <tytso@mit.edu>2012-03-21 21:47:55 -0400
commitafcff5d80a4106e732d903640161d23950eb8e3b (patch)
tree9a78cb5546c3f10bb98d3ce8b4f31889f5ad10bc /fs
parenta7967f055a9438941268d725b268141c57e32a05 (diff)
ext4: remove restrictive checks for EOFBLOCKS_FL
We are going to remove the EOFBLOCKS_FL flag in the future, so this is the first part of the removal. We can not remove it entirely just now, since the e2fsck is still checking for it and it might cause headache to some people. Instead, remove the restrictive checks now and the rest later, when the new e2fsck code is out and common enough. This is also needed because punch hole already breaks the EOFBLOCKS_FL semantics, so it might cause the some troubles. So simply remove it. Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/extents.c13
-rw-r--r--fs/ext4/inode.c6
2 files changed, 10 insertions, 9 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index d075f34f9bae..1421938e6792 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3293,11 +3293,13 @@ static int check_eofblocks_fl(handle_t *handle, struct inode *inode,
3293 depth = ext_depth(inode); 3293 depth = ext_depth(inode);
3294 eh = path[depth].p_hdr; 3294 eh = path[depth].p_hdr;
3295 3295
3296 if (unlikely(!eh->eh_entries)) { 3296 /*
3297 EXT4_ERROR_INODE(inode, "eh->eh_entries == 0 and " 3297 * We're going to remove EOFBLOCKS_FL entirely in future so we
3298 "EOFBLOCKS_FL set"); 3298 * do not care for this case anymore. Simply remove the flag
3299 return -EIO; 3299 * if there are no extents.
3300 } 3300 */
3301 if (unlikely(!eh->eh_entries))
3302 goto out;
3301 last_ex = EXT_LAST_EXTENT(eh); 3303 last_ex = EXT_LAST_EXTENT(eh);
3302 /* 3304 /*
3303 * We should clear the EOFBLOCKS_FL flag if we are writing the 3305 * We should clear the EOFBLOCKS_FL flag if we are writing the
@@ -3321,6 +3323,7 @@ static int check_eofblocks_fl(handle_t *handle, struct inode *inode,
3321 for (i = depth-1; i >= 0; i--) 3323 for (i = depth-1; i >= 0; i--)
3322 if (path[i].p_idx != EXT_LAST_INDEX(path[i].p_hdr)) 3324 if (path[i].p_idx != EXT_LAST_INDEX(path[i].p_hdr))
3323 return 0; 3325 return 0;
3326out:
3324 ext4_clear_inode_flag(inode, EXT4_INODE_EOFBLOCKS); 3327 ext4_clear_inode_flag(inode, EXT4_INODE_EOFBLOCKS);
3325 return ext4_mark_inode_dirty(handle, inode); 3328 return ext4_mark_inode_dirty(handle, inode);
3326} 3329}
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 83a2daeb813c..27ee10d66fcd 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4163,11 +4163,9 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
4163 } 4163 }
4164 4164
4165 if (attr->ia_valid & ATTR_SIZE) { 4165 if (attr->ia_valid & ATTR_SIZE) {
4166 if (attr->ia_size != i_size_read(inode)) { 4166 if (attr->ia_size != i_size_read(inode))
4167 truncate_setsize(inode, attr->ia_size); 4167 truncate_setsize(inode, attr->ia_size);
4168 ext4_truncate(inode); 4168 ext4_truncate(inode);
4169 } else if (ext4_test_inode_flag(inode, EXT4_INODE_EOFBLOCKS))
4170 ext4_truncate(inode);
4171 } 4169 }
4172 4170
4173 if (!rc) { 4171 if (!rc) {