From: Goldwyn Rodrigues <rgoldwyn@gmail.com>
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 15:00:58 -0600 [thread overview]
Message-ID: <AANLkTinkyJa0m230Pyu=PdQRsDL62FSXLmTeGYO_s2hN@mail.gmail.com> (raw)
In-Reply-To: <20110223192826.GB4020@noexit>
Hi Joel,
On Wed, Feb 23, 2011 at 1:28 PM, Joel Becker <jlbec@evilplan.org> wrote:
> On Wed, Feb 23, 2011 at 11:13:39AM -0800, Joel Becker wrote:
>> The calling code should have made sure we are correctly passing
>> should_zero to all non-target pages. ?Having new overridden for them is
>> wrong. ?So maybe we move your check inside the target_page if. ?It only
>> really matters for the target page.
>
> ? ? ? ?Actually, I have a question: what is the clustersize of your
> test? ?Because if the filesystem is 4k/4k, the write at 4096 of 32 bytes
> should allocate a new cluster. ?'new' should already be set, and your
> check irrelevant.
It is 16K and does not happen for clustersize==pagesize/blocksize.
Don't have a machine with a bigger pagesize handy.
>
>> ? ? ? But wait! ?Check out block_write_full_page_endio() in
>> fs/buffer.c! ?Especially this part:
>>
>> ? ? ? zero_user_segment(page, offset, PAGE_CACHE_SIZE);
>>
>> It is zeroing the tail of a page when it straddles i_size to make sure
>> it goes out correctly. ?But, of course, blocks past i_size never go to
>> disk. ?And we don't care; readpage should handle them correctly, right?
>> So if writepage is going to zero for us, and readpage is going to read
>> correctly, how are you getting bad data?
>> ? ? ? 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?
>
> ? ? ? ?One thing I would like to see are the results with fsync()
> between writeSparse() and checkSparselyWrittenFile(). ?Forcing the file
> to disk before checking the values will tell us something. ?This is with
> my patch but without yours.
> ? ? ? ?Another good test would be to umount/mount between writeSparse()
> and checkSparselyWrittenFile(). ?This tells us what actually hit disk.
>
No, fsync does not work. I still get junk in the holes. Same is the
case if I umount and re-mount the disk.
--
Goldwyn
next prev parent reply other threads:[~2011-02-23 21:00 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 [this message]
2011-02-23 21:23 ` Joel Becker
2011-02-23 20:54 ` Goldwyn Rodrigues
2011-02-23 21:17 ` Joel Becker
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='AANLkTinkyJa0m230Pyu=PdQRsDL62FSXLmTeGYO_s2hN@mail.gmail.com' \
--to=rgoldwyn@gmail.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 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).