mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 16:58:53 +00:00
ocfs2: truncate outstanding block after direct io failure
Signed-off-by: Dmitri Monakhov <dmonakhov@openvz.org> Cc: Jeff Moyer <jmoyer@redhat.com> Cc: Mark Fasheh <mark.fasheh@oracle.com> Cc: Joel Becker <Joel.Becker@oracle.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
This commit is contained in:
parent
80bcaf3469
commit
c435400140
@ -1866,6 +1866,13 @@ relock:
|
|||||||
written = generic_file_direct_write(iocb, iov, &nr_segs, *ppos,
|
written = generic_file_direct_write(iocb, iov, &nr_segs, *ppos,
|
||||||
ppos, count, ocount);
|
ppos, count, ocount);
|
||||||
if (written < 0) {
|
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;
|
ret = written;
|
||||||
goto out_dio;
|
goto out_dio;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user