mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
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>
This commit is contained in:
parent
ab94c39b6f
commit
7eb4969e04
1 changed files with 3 additions and 2 deletions
|
|
@ -1785,8 +1785,9 @@ retry:
|
|||
handle = ext3_journal_start(inode, 2);
|
||||
if (IS_ERR(handle)) {
|
||||
/* This is really bad luck. We've written the data
|
||||
* but cannot extend i_size. Bail out and pretend
|
||||
* the write failed... */
|
||||
* but cannot extend i_size. Truncate allocated blocks
|
||||
* and pretend the write failed... */
|
||||
ext3_truncate(inode);
|
||||
ret = PTR_ERR(handle);
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue