]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/ocfs2-return-0-in-page_mkwrite-to-let-VFS-retry.patch
Reenabled linux-xen and xen-image build
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / ocfs2-return-0-in-page_mkwrite-to-let-VFS-retry.patch
CommitLineData
00e5a55c
BS
1From: Tao Ma <tao.ma@oracle.com>
2Date: Mon, 6 Oct 2008 16:59:55 +0800
3Subject: ocfs2: return 0 in page_mkwrite to let VFS retry.
4
5In ocfs2_page_mkwrite, we return -EINVAL when we found the page mapping
6isn't updated, and it will cause the user space program get SIGBUS and
7exit. The reason is that during race writeable mmap, we will do
8unmap_mapping_range in ocfs2_data_downconvert_worker. The good thing is
9that if we reuturn 0 in page_mkwrite, VFS will retry fault and then
10call page_mkwrite again, so it is safe to return 0 here.
11
12Signed-off-by: Tao Ma <tao.ma@oracle.com>
13Signed-off-by: Mark Fasheh <mfasheh@suse.com>
14---
15 fs/ocfs2/mmap.c | 6 +++++-
16 1 files changed, 5 insertions(+), 1 deletions(-)
17
18Index: linux-2.6.27-ocfs2/fs/ocfs2/mmap.c
19===================================================================
20--- linux-2.6.27-ocfs2.orig/fs/ocfs2/mmap.c
21+++ linux-2.6.27-ocfs2/fs/ocfs2/mmap.c
22@@ -113,7 +113,11 @@ static int __ocfs2_page_mkwrite(struct i
23 * ocfs2_write_begin_nolock().
24 */
25 if (!PageUptodate(page) || page->mapping != inode->i_mapping) {
26- ret = -EINVAL;
27+ /*
28+ * the page has been umapped in ocfs2_data_downconvert_worker.
29+ * So return 0 here and let VFS retry.
30+ */
31+ ret = 0;
32 goto out;
33 }
34