[Ocfs2-devel] [PATCH] Treat writes as new when holes span across page boundaries

Goldwyn Rodrigues rgoldwyn at gmail.com
Tue Feb 22 14:09:47 PST 2011


On Tue, Feb 22, 2011 at 3:54 PM, Joel Becker <jlbec at evilplan.org> wrote:
> On Tue, Feb 22, 2011 at 01:39:28PM -0800, Joel Becker wrote:
>> On Tue, Feb 22, 2011 at 01:02:13PM -0600, Goldwyn Rodrigues wrote:
>> > On Tue, Feb 22, 2011 at 2:36 AM, Joel Becker <jlbec at evilplan.org> wrote:
>> > >        Please try the attached patch and see if it fixes the problem.
>> > > It should work on its own, without your changes.  If I have it wrong,
>> > > we'll continue to evaluate the problem.  I'd test it myself, but my VM
>> > > setup is currently broken.
>> > >
>> >
>> > It does not work. However, it shows the behavior similar to "nosparse"
>> > without patch. So, I would say what you are targeting is achieved but
>> > another problem resurfaces. This is because nothing zeros pages beyond
>> > i_size in ocfs2_map_page_blocks(), since we return early because of -
>> >
>> >         if (ret == 0 || !new)
>> >                 return ret;
>>
>>       Returning here is correct, because ret should == 0.  The new
>> part is about zeroing in the case of error.  We should obviously handle
>> it better before we get to this line.
>>       I like that we come in line nosparse and sparse.  What does
>> tailtest do for you?  Does it fail or succeed?
>
>        Looking some more.  ocfs2_zero_tail() is supposed to handle
> this, isn't it?  ocfs2_write_begin_nolock() calls ocfs2_zero_tail(pos),
> which calls ocfs2_zero_extend(pos), which works up to
> ocfs2_clusters_for_bytes(pos).  Doesn't this include your cluster?
> Shouldn't the page already be loaded into the pagecache with zeros?
>
>

Din't you discard that idea in my previous attempt? ;)

On a serious note, no it doesn't because zero_start and zero_to_size
are the same when pos is on a block boundary and hence the loop does
not execute.


-- 
Goldwyn



More information about the Ocfs2-devel mailing list