]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/ocfs2-truncate-outstanding-block-after-direct-io-fa.patch
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / ocfs2-truncate-outstanding-block-after-direct-io-fa.patch
CommitLineData
00e5a55c
BS
1From: Dmitri Monakhov <dmonakhov@openvz.org>
2Date: Mon, 27 Oct 2008 13:01:49 -0700
3Subject: ocfs2: truncate outstanding block after direct io failure
4
5Signed-off-by: Dmitri Monakhov <dmonakhov@openvz.org>
6Cc: Jeff Moyer <jmoyer@redhat.com>
7Cc: Mark Fasheh <mark.fasheh@oracle.com>
8Cc: Joel Becker <Joel.Becker@oracle.com>
9Cc: Nick Piggin <nickpiggin@yahoo.com.au>
10Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
11Signed-off-by: Mark Fasheh <mfasheh@suse.com>
12---
13 fs/ocfs2/file.c | 7 +++++++
14 1 files changed, 7 insertions(+), 0 deletions(-)
15
16Index: linux-2.6.27-ocfs2/fs/ocfs2/file.c
17===================================================================
18--- linux-2.6.27-ocfs2.orig/fs/ocfs2/file.c
19+++ linux-2.6.27-ocfs2/fs/ocfs2/file.c
20@@ -1866,6 +1866,13 @@ relock:
21 written = generic_file_direct_write(iocb, iov, &nr_segs, *ppos,
22 ppos, count, ocount);
23 if (written < 0) {
24+ /*
25+ * direct write may have instantiated a few
26+ * blocks outside i_size. Trim these off again.
27+ * Don't need i_size_read because we hold i_mutex.
28+ */
29+ if (*ppos + count > inode->i_size)
30+ vmtruncate(inode, inode->i_size);
31 ret = written;
32 goto out_dio;
33 }