summaryrefslogtreecommitdiff
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-03-17 03:12:23 (GMT)
committerTheodore Ts'o <tytso@mit.edu>2009-03-17 03:12:23 (GMT)
commitafd4672dc7610b7feef5190168aa917cc2e417e4 (patch)
tree53a3aa709232b00473c8da70b792b350150956ff /fs/ext4/inode.c
parent7d39db14a42cbd719c7515b9da8f85a2eb6a0633 (diff)
downloadlinux-fsl-qoriq-afd4672dc7610b7feef5190168aa917cc2e417e4.tar.xz
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 d3118d1..bed4a0a 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3908,7 +3908,7 @@ void ext4_truncate(struct inode *inode)
if (!ext4_can_truncate(inode))
return;
- if (inode->i_size == 0)
+ if (inode->i_size == 0 && !test_opt(inode->i_sb, NO_AUTO_DA_ALLOC))
ei->i_state |= EXT4_STATE_DA_ALLOC_CLOSE;
if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) {