diff --git a/[refs] b/[refs] index 3566ed5549a2..6350cfd6735d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 80bcaf3469b8aefd316d4ceb27d9af7cfbb0b913 +refs/heads/master: c435400140d24fbcb3da6b1e006be831f9056cb6 diff --git a/trunk/fs/ocfs2/file.c b/trunk/fs/ocfs2/file.c index 3138a385fdbb..e2570a3bc2b2 100644 --- a/trunk/fs/ocfs2/file.c +++ b/trunk/fs/ocfs2/file.c @@ -1866,6 +1866,13 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, written = generic_file_direct_write(iocb, iov, &nr_segs, *ppos, ppos, count, ocount); if (written < 0) { + /* + * direct write may have instantiated a few + * blocks outside i_size. Trim these off again. + * Don't need i_size_read because we hold i_mutex. + */ + if (*ppos + count > inode->i_size) + vmtruncate(inode, inode->i_size); ret = written; goto out_dio; }