All of lore.kernel.org
 help / color / mirror / Atom feed
From: Goldwyn Rodrigues <rgoldwyn@gmail.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] Zero from EOF instead of next block
Date: Mon, 14 Feb 2011 12:24:01 -0600	[thread overview]
Message-ID: <AANLkTikTP7wtSGsoUSw1pVT6aWDrjSYFrn_A+8Aam9HD@mail.gmail.com> (raw)
In-Reply-To: <20110214072503.GA8413@noexit>

On Mon, Feb 14, 2011 at 1:25 AM, Joel Becker <jlbec@evilplan.org> wrote:
> On Mon, Feb 14, 2011 at 12:21:41AM -0600, Goldwyn Rodrigues wrote:
>> ocfs2_zero_extend() extends the file from the next page offset
>> rather from the current file size. zero_extend_page() should
>> call ocfs2_zero_partial_cluster() to set zero rest of the cluster
>> when the file size is within the page boundaries.
>
> ? ? ? ?We just went over this. ?It is intentional that we start from
> the next block. ?Linux code always assumes that the block containing
> i_size is properly zeroed to its end. ?Our last set of fixes for this
> made sure we were doing that correctly. ?Or so I thought.
> ? ? ? ?Your patch description looks like you are worried that we don't
> zero from EOF to End-Of-Block. ?Have you proof we've failed that again?
> Or are you worried that we don't zero from EOB to End-Of-Cluster? ?We
> used to zero to EOC, but we now know that to be a mistake.
>

Why is zeroing to EOC a mistake?

I ran my tests again and found the problem to be from EOB to
End-of-cluster, and of course this happens only with
blocksize<clustersize. So, in ocfs2_zero_extend rewriting zero_to_size
to end-of-cluster works correctly  -

zero_to_size = ocfs2_align_bytes_to_clusters(sb, zero_to_size);

The test case is attached. Modify run_ocfs2_sparse_writing_test.sh accordingly.

-- 
Goldwyn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ocfs2_sparse_writing_test_kit.tbz
Type: application/x-bzip-compressed-tar
Size: 2558 bytes
Desc: not available
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20110214/0b0c8fb7/attachment.bin 

  reply	other threads:[~2011-02-14 18:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14  6:21 [Ocfs2-devel] [PATCH] Zero from EOF instead of next block Goldwyn Rodrigues
2011-02-14  7:25 ` Joel Becker
2011-02-14 18:24   ` Goldwyn Rodrigues [this message]
2011-02-14 22:00     ` Joel Becker
2011-02-14 22:02       ` Joel Becker
2011-02-14 22:16       ` Goldwyn Rodrigues
2011-02-14 22:25         ` Joel Becker
2011-02-16  6:26           ` Goldwyn Rodrigues
2011-02-16 14:24             ` Goldwyn Rodrigues

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=AANLkTikTP7wtSGsoUSw1pVT6aWDrjSYFrn_A+8Aam9HD@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 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.