aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/inode.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-03-01 08:02:37 -0500
committerJan Kara <jack@suse.cz>2010-03-04 18:20:27 -0500
commit7eb4969e04060dcf3fbd46af9c21b1059b853068 (patch)
treeac093841df6abbe2d517af6656b149ad42536648 /fs/ext3/inode.c
parentab94c39b6fa076d4f6d2903dcc54cda35d938776 (diff)
ext3: Truncate allocated blocks if direct IO write fails to update i_size
We have to truncate blocks allocated to file during direct IO when we fail to update i_size properly. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3/inode.c')
-rw-r--r--fs/ext3/inode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 44b53386ab8b..c0ff9d6ffde6 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1785,8 +1785,9 @@ retry:
1785 handle = ext3_journal_start(inode, 2); 1785 handle = ext3_journal_start(inode, 2);
1786 if (IS_ERR(handle)) { 1786 if (IS_ERR(handle)) {
1787 /* This is really bad luck. We've written the data 1787 /* This is really bad luck. We've written the data
1788 * but cannot extend i_size. Bail out and pretend 1788 * but cannot extend i_size. Truncate allocated blocks
1789 * the write failed... */ 1789 * and pretend the write failed... */
1790 ext3_truncate(inode);
1790 ret = PTR_ERR(handle); 1791 ret = PTR_ERR(handle);
1791 goto out; 1792 goto out;
1792 } 1793 }