[Ocfs2-devel] [PATCH] Zero from EOF instead of next block

Goldwyn Rodrigues rgoldwyn at gmail.com
Mon Feb 14 10:24:01 PST 2011


On Mon, Feb 14, 2011 at 1:25 AM, Joel Becker <jlbec at 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 


More information about the Ocfs2-devel mailing list