From: NeilBrown Date: Fri, 13 Aug 2010 03:55:46 +0000 (+1000) Subject: lafs_write_end: set new file size correctly. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=0ab195efb039dd9d836405061b3624a18341a66f;p=LaFS.git lafs_write_end: set new file size correctly. We were setting the size to the start of the write, not the end!! Signed-off-by: NeilBrown --- diff --git a/file.c b/file.c index 60c0c58..fcbf9bd 100644 --- a/file.c +++ b/file.c @@ -268,8 +268,8 @@ lafs_write_end(struct file *file, * No need to use i_size_read() here, the i_size * cannot change under us because we hold i_sem. */ - if (pos > ino->i_size) { - i_size_write(ino, pos); + if (pos + len > ino->i_size) { + i_size_write(ino, pos + len); /* note that we deliberately don't call * mark_inode_dirty(ino); * The inode will automatically be written