From: Joel Becker <jlbec@evilplan.org>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] Treat writes as new when holes span across page boundaries
Date: Wed, 23 Feb 2011 13:17:05 -0800 [thread overview]
Message-ID: <20110223211704.GH4020@noexit> (raw)
In-Reply-To: <AANLkTimrFoVm11T=Hyq+Uf7wfX8n7zSZStNnAs4sPmvK@mail.gmail.com>
On Wed, Feb 23, 2011 at 02:54:19PM -0600, Goldwyn Rodrigues wrote:
> On Wed, Feb 23, 2011 at 1:13 PM, Joel Becker <jlbec@evilplan.org> wrote:
> > ? ? ? ?I was about to think we were done, but now I'm not so sure. ?I
> > have a question: with my change to ocfs2_should_read_block(), but
> > without your patch, what do you see for corruption? ?Your pattern
> > written in the first pass, or complete random garbage?
>
> Joel, you are getting confused in the list of parameters to reproduce
> the bug. I have listed it in the past, but not in a single location so
> it is difficult to pick up the bits. I will put it together for you.
Goldwyn,
I'm just not remembering off the top of my head, so I'm asking.
I'm actually describing the myriad cases we can encounter in this code,
because any change we make has to be safe for all possible cases.
> 1. blocksize < clustersize
Ok.
> 2. the previous write ended in a page boundary, but not a cluster
> boundary. eg, clustersize=16K but pos is at the page boundary = 4k
Must it be a page boundary? What about a block boundary? ;-)
> 3. you wrote something at the page boundary
I think it's more block than page, really. But that is the same
for 4K blocks and pages.
> 4. there is a hole created in the page from 4k-8k in *between* say 4128-4640
There is no hole here. We have allocation. Even if the user
doesn't directly write to this location, it is not a hole, because we
have a cluster there. You just mean that the user didn't write to this
location (sparse writing). That's just a terminology thing, but it's
important for other folks understanding you.
> What I am seeing is pure junk(not 0xbaadfeed), and not what I had
> written earlier.
Ok. That's what I expected. I wanted to clarify we were not
reading stale data, but were instead failing to zero memory.
> In retrospect, since we have covered the rest of the bases, we can set
> new on the condition:
>
> i_size == page_offset == pos
>
> I interpreted new as new page or new data vs new cluster, and perhaps
> that is the reason I placed the condition there.
I don't like this. We still haven't figured out where we're
failing.
The core piece of this, why I'm going back and forth with you
discussing the issue, is that we never want to paper over a symptom.
Sure, we know that i_size==page_offset==pos triggers this, but is it the
only case? If we figure out *why* we're here, when the code is supposed
to not have this problem, then we can be sure we've closed out all
exposure.
To wit: If we really only have a problem when i_size is on a
page boundary, doesn't that sound like an off-by-one error? We've had
those before. I'm not sure that it is, but shouldn't we be sure about
it?
Joel
--
"But then she looks me in the eye
And says, 'We're going to last forever,'
And man you know I can't begin to doubt it.
Cause it just feels so good and so free and so right,
I know we ain't never going to change our minds about it, Hey!
Here comes my girl."
http://www.jlbec.org/
jlbec at evilplan.org
next prev parent reply other threads:[~2011-02-23 21:17 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-17 15:44 [Ocfs2-devel] [PATCH] Treat writes as new when holes span across page boundaries Goldwyn Rodrigues
2011-02-20 7:09 ` Joel Becker
2011-02-20 18:45 ` Goldwyn Rodrigues
2011-02-21 2:08 ` Joel Becker
2011-02-21 5:44 ` Goldwyn Rodrigues
2011-02-22 8:36 ` Joel Becker
2011-02-22 9:37 ` Joel Becker
2011-02-22 19:02 ` Goldwyn Rodrigues
2011-02-22 21:39 ` Joel Becker
2011-02-22 21:54 ` Joel Becker
2011-02-22 22:09 ` Goldwyn Rodrigues
2011-02-22 23:34 ` Joel Becker
2011-02-23 0:05 ` Goldwyn Rodrigues
2011-02-23 9:39 ` Joel Becker
2011-02-23 14:43 ` Goldwyn Rodrigues
2011-02-23 19:13 ` Joel Becker
2011-02-23 19:28 ` Joel Becker
2011-02-23 21:00 ` Goldwyn Rodrigues
2011-02-23 21:23 ` Joel Becker
2011-02-23 20:54 ` Goldwyn Rodrigues
2011-02-23 21:17 ` Joel Becker [this message]
2011-02-23 21:35 ` Goldwyn Rodrigues
2011-02-23 21:37 ` Joel Becker
2011-02-23 21:44 ` Joel Becker
2011-02-23 22:31 ` Goldwyn Rodrigues
2011-02-28 18:03 ` Joel Becker
2011-02-28 19:07 ` Goldwyn Rodrigues
2011-02-28 19:40 ` Joel Becker
2011-03-01 2:11 ` Goldwyn Rodrigues
2011-02-24 16:32 ` Goldwyn Rodrigues
2011-02-24 18:16 ` Mark Fasheh
2011-02-23 21:09 ` Goldwyn Rodrigues
2011-02-23 21:21 ` Joel Becker
2011-03-26 22:48 ` Joel Becker
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=20110223211704.GH4020@noexit \
--to=jlbec@evilplan.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).