ext3: Improve truncate error handling
commitee3e77f18010679a889b3831c2dd931238c12d09
authorJan Kara <jack@suse.cz>
Fri, 3 Jun 2011 19:58:11 +0000 (3 21:58 +0200)
committerJan Kara <jack@suse.cz>
Sat, 25 Jun 2011 15:29:52 +0000 (25 17:29 +0200)
tree761c06de9b82cba8a8a2e1cd2174fe7afa59efd9
parent9008593017069ad513cc7dc78a6c94e8dfddba31
ext3: Improve truncate error handling

New truncate calling convention allows us to handle errors from
ext3_block_truncate_page(). So reorganize the code so that
ext3_block_truncate_page() is called before we change inode size.

This also removes unnecessary block zeroing from error recovery after failed
buffered writes (zeroing isn't needed because we could have never written
non-zero data to disk). We have to be careful and keep zeroing in direct IO
write error recovery because there we might have already overwritten end of the
last file block.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext3/inode.c