From: tristan <tristan.ye@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH v5] ocfs2: Don't duplicate page passes i_size during CoW.
Date: Thu, 15 Jul 2010 09:15:24 +0800 [thread overview]
Message-ID: <4C3E612C.30508@oracle.com> (raw)
In-Reply-To: <1279077572-9017-1-git-send-email-tao.ma@oracle.com>
Tested-by: Tristan Ye <tristan.ye@oracle.com>
Tao Ma wrote:
> During CoW, actually all the pages after i_size contains
> garbage data, so don't read and duplicate them.
>
> Signed-off-by: Tao Ma <tao.ma@oracle.com>
> ---
> fs/ocfs2/refcounttree.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
> index 1cf9cda..5e03db2 100644
> --- a/fs/ocfs2/refcounttree.c
> +++ b/fs/ocfs2/refcounttree.c
> @@ -2931,6 +2931,12 @@ static int ocfs2_duplicate_clusters_by_page(handle_t *handle,
>
> offset = ((loff_t)cpos) << OCFS2_SB(sb)->s_clustersize_bits;
> end = offset + (new_len << OCFS2_SB(sb)->s_clustersize_bits);
> + /*
> + * We only duplicate pages until we reach the page contains i_size - 1.
> + * So trim 'end' to i_size.
> + */
> + if (end > i_size_read(context->inode))
> + end = i_size_read(context->inode);
>
> while (offset < end) {
> page_index = offset >> PAGE_CACHE_SHIFT;
next prev parent reply other threads:[~2010-07-15 1:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-12 7:19 [Ocfs2-devel] [PATCH] ocfs2: Don't duplicate page passes i_size during CoW Tao Ma
2010-07-12 9:14 ` Joel Becker
2010-07-13 3:22 ` [Ocfs2-devel] [PATCH v2] " Tao Ma
2010-07-13 8:13 ` Joel Becker
2010-07-13 8:15 ` Joel Becker
2010-07-13 14:25 ` Tao Ma
2010-07-13 18:38 ` Joel Becker
2010-07-14 0:29 ` Tao Ma
2010-07-14 3:19 ` [Ocfs2-devel] [PATCH v5] " Tao Ma
2010-07-15 1:15 ` tristan [this message]
2010-07-15 21:02 ` Joel Becker
2010-07-13 14:50 ` [Ocfs2-devel] [PATCH v3] " Tao Ma
2010-07-13 15:30 ` [Ocfs2-devel] [PATCH v4] " Tao Ma
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=4C3E612C.30508@oracle.com \
--to=tristan.ye@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.