All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH v2] ocfs2: Don't duplicate page passes i_size during CoW.
Date: Tue, 13 Jul 2010 11:38:29 -0700	[thread overview]
Message-ID: <20100713183828.GA9468@mail.oracle.com> (raw)
In-Reply-To: <4C3C7771.5000103@oracle.com>

On Tue, Jul 13, 2010 at 10:25:53PM +0800, Tao Ma wrote:
> Joel Becker wrote:
> >	Why even worry about that?  We only need up to i_size.  If end
> >is safe and not page aligned, so is i_size.
> i_size isn't safe in ocfs2_duplicate_clusters_by_page. Check the
> below function.
> 
>            if (page_has_buffers(page)) {
>                        ret = walk_page_buffers(handle, page_buffers(page),
>                                                from, to, &partial,
>                                                ocfs2_clear_cow_buffer);
>                        if (ret) {
>                                mlog_errno(ret);
>                                goto unlock;
>                        }
>                }
> So 'to' is limited to 'map_end' and then 'end'. If we set 'end' to
> i_size, we may not clear all the buffer heads

	We don't need to clear all the buffer heads.  This is the same
as the logic in block_prepare_write().  We only need to clear the blocks
that encompass i_size.  Unless we did something wrong, the buffers past
i_size should not be mapped.
	More importantly, your 'end' has the same layout.  If end is not
page aligned, it will only clear some of the blocks in its page.  Which
is fine.  There's no difference between end and i_size - they don't have
to fall on page boundaries.

Joel

-- 

"Here's something to think about:  How come you never see a headline
 like ``Psychic Wins Lottery''?"
	- Jay Leno

Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

  reply	other threads:[~2010-07-13 18:38 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 [this message]
2010-07-14  0:29             ` Tao Ma
2010-07-14  3:19             ` [Ocfs2-devel] [PATCH v5] " Tao Ma
2010-07-15  1:15               ` tristan
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=20100713183828.GA9468@mail.oracle.com \
    --to=joel.becker@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.