Messages in this thread Patch in this message | | | From | Dmitri Monakhov <> | Subject | [PATCH 2/2] ocfs2: truncate outstanding block after direct io failure. | Date | Sun, 19 Oct 2008 18:03:01 +0400 |
| |
Signed-off-by: Dmitri Monakhov <dmonakhov@openvz.org> --- fs/ocfs2/file.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 8d3225a..0b68b30 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1867,6 +1867,13 @@ relock: 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; } -- 1.5.4.3
| |