On Mon, Apr 03, 2017 at 06:09:27PM +0200, Max Reitz wrote: > Currently, raw_regular_truncate() is intended for setting the size of a > newly created file. However, we also want to use it for truncating an > existing file in which case only the newly added space (when growing) > should be preallocated. > > This also means that if resizing failed, we should try to restore the > original file size. This is important when using preallocation. > > Signed-off-by: Max Reitz > --- > block/file-posix.c | 61 ++++++++++++++++++++++++++++++++++++++++++++---------- > 1 file changed, 50 insertions(+), 11 deletions(-) Reviewed-by: Stefan Hajnoczi