Thread (18 messages) read the whole thread 18 messages, 4 authors, 2009-03-12

Re: [PATCH, RFC] ext4: Automatically allocate delay allocated blocks on close

From: Theodore Tso <tytso@mit.edu>
Date: 2009-02-24 13:21:11

On Tue, Feb 24, 2009 at 03:13:44AM -0700, Andreas Dilger wrote:
On Feb 24, 2009  00:05 -0500, Theodore Ts'o wrote:
quoted
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.
Should this only be done with "truncate-to-zero" operations, or any
truncate?  Some applications may do extending truncates in order to
trigger file preallocation ala Windows, and we don't necessarily want
to punish all of the IO for those files.
Agreed, we should only do this on a truncate-to-zero.  I'll fix up the
patch to only set EXT4_STATE_DA_ALLOC_CLOSE on truncate if
inode->i_size is 0.

							- Ted
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help