From: Aneesh Kumar K.V Date: Fri, 5 Jun 2009 04:56:49 +0000 (-0400) Subject: ext4: truncate the file properly if we fail to copy data from userspace X-Git-Tag: v2.6.31-rc1~396^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8514083cd61daef12fba5ef883ad9352c450428;p=pandora-kernel.git ext4: truncate the file properly if we fail to copy data from userspace In generic_perform_write if we fail to copy the user data we don't update the inode->i_size. We should truncate the file in the above case so that we don't have blocks allocated outside inode->i_size. Add the inode to orphan list in the same transaction as block allocation This ensures that if we crash in between the recovery would do the truncate. Signed-off-by: Aneesh Kumar K.V CC: Jan Kara Signed-off-by: "Theodore Ts'o" --- Reading git-diff-tree failed