From: Sunil Mushran <sunil.mushran@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2/mmap: return 0 in page_mkwrite to let VFS retry.
Date: Mon, 06 Oct 2008 10:15:45 -0700 [thread overview]
Message-ID: <48EA47C1.5090407@oracle.com> (raw)
In-Reply-To: <1223283595-4316-1-git-send-email-tao.ma@oracle.com>
Tao,
Please can you attach this to the bugzilla.
http://oss.oracle.com/bugzilla/show_bug.cgi?id=1019
Easier to track fixes.
Thanks
Sunil
Tao Ma wrote:
> In ocfs2_page_mkwrite, we return -EINVAL when we found the page mapping
> isn't updated, and it will cause the user space program get SIGBUS and
> exit. The reason is that during race writeable mmap, we will do
> unmap_mapping_range in ocfs2_data_downconvert_worker. The good thing is
> that if we reuturn 0 in page_mkwrite, VFS will retry fault and then
> call page_mkwrite again, so it is safe to return 0 here.
>
> Signed-off-by: Tao Ma <tao.ma@oracle.com>
> ---
> fs/ocfs2/mmap.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c
> index 3dc18d6..eea1d24 100644
> --- a/fs/ocfs2/mmap.c
> +++ b/fs/ocfs2/mmap.c
> @@ -113,7 +113,11 @@ static int __ocfs2_page_mkwrite(struct inode *inode, struct buffer_head *di_bh,
> * ocfs2_write_begin_nolock().
> */
> if (!PageUptodate(page) || page->mapping != inode->i_mapping) {
> - ret = -EINVAL;
> + /*
> + * the page has been umapped in ocfs2_data_downconvert_worker.
> + * So return 0 here and let VFS retry.
> + */
> + ret = 0;
> goto out;
> }
>
>
prev parent reply other threads:[~2008-10-06 17:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-06 8:59 [Ocfs2-devel] [PATCH] ocfs2/mmap: return 0 in page_mkwrite to let VFS retry Tao Ma
2008-10-06 17:15 ` Sunil Mushran [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48EA47C1.5090407@oracle.com \
--to=sunil.mushran@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.