aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-03-16 23:12:23 -0400
committerTheodore Ts'o <tytso@mit.edu>2009-03-16 23:12:23 -0400
commitafd4672dc7610b7feef5190168aa917cc2e417e4 (patch)
tree53a3aa709232b00473c8da70b792b350150956ff /fs/ext4/inode.c
parent7d39db14a42cbd719c7515b9da8f85a2eb6a0633 (diff)
ext4: Add auto_da_alloc mount option
Add a mount option which allows the user to disable automatic allocation of blocks whose allocation by delayed allocation when the file was originally truncated or when the file is renamed over an existing file. This feature is intended to save users from the effects of naive application writers, but it reduces the effectiveness of the delayed allocation code. This mount option disables this safety feature, which may be desirable for prodcutions systems where the risk of unclean shutdowns or unexpected system crashes is low. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index d3118d1acc39..bed4a0abd0d1 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3908,7 +3908,7 @@ void ext4_truncate(struct inode *inode)
3908 if (!ext4_can_truncate(inode)) 3908 if (!ext4_can_truncate(inode))
3909 return; 3909 return;
3910 3910
3911 if (inode->i_size == 0) 3911 if (inode->i_size == 0 && !test_opt(inode->i_sb, NO_AUTO_DA_ALLOC))
3912 ei->i_state |= EXT4_STATE_DA_ALLOC_CLOSE; 3912 ei->i_state |= EXT4_STATE_DA_ALLOC_CLOSE;
3913 3913
3914 if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) { 3914 if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) {