ext4: Automatically allocate delay allocated blocks on close
commit23ae18d466ab83fc4b9829b331ee82899bccdeff
authorTheodore Ts'o <tytso@mit.edu>
Tue, 2 Jun 2009 12:07:47 +0000 (2 08:07 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 15 Jun 2009 16:40:24 +0000 (15 09:40 -0700)
tree6edfb65b7c15d9e63b1c4cc94b8b04458a52bd82
parent9dc84851a33e1dda83cfecfee130e26c92c8a3bb
ext4: Automatically allocate delay allocated blocks on close

(cherry picked from commit 7d8f9f7d150dded7b68e61ca6403a1f166fb4edf)

When closing a file that had been previously truncated, force any
delay allocated blocks that to be allocated so that if the filesystem
is mounted with data=ordered, the data blocks will be pushed out to
disk along with the journal commit.  Many application programs expect
this, so we do this to avoid zero length files if the system crashes
unexpectedly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/ext4.h
fs/ext4/file.c
fs/ext4/inode.c