On Tue, Sep 03, 2013 at 09:52:55PM +0200, Jean-Pierre André wrote:

[snip]

> >I made a simple change, I set the initialized size to be equal to data
> >size:
> >
> >attr->initialized_size = cpu_to_le64(na->data_size);
> >
> >instead of:
> >
> >attr->initialized_size = cpu_to_le64(na->initialized_size);
> >
> >That seems to have solved the issue I was having. Now, I am using the
> >fuse drive to do the writes and all works as expected.
> >
> >What do you think of that change?
> 
> This is wrong, you make the file to be visible up to its
> apparent size, even in parts not yet written to. However
> this shows that what I suggested (quoted above) would
> do the job.
> 
> Initialized size serves as a fence to indicate the part of
> a file which has not been written to, and should not be
> disclosed. This allocated space may contain data left
> over by another user. Data size is the apparent size of
> the file and the space between initialized size and data
> size must appear as zeroed when read.
> 
> A bad limitation of ntfs is that when you write near the
> end of file, you have to zero the gap from the previous
> initialized space, and that may take a long time, but
> this is not a problem if you write sequentially from the
> beginning.

Thanks for the clarification. You are right, it turns out I had to write
a footer section first and thus when calling fsync on fuse, the speed
would drop down significantly. This is because of the limitation you
mentioned regarding ntfs and zeroing out.

> 
> Note : I have implemented a full ntfsfallocate, but my
> tests show that Windows sometimes crashes when
> writing to preallocated space, so I will not release
> such code.

May I ask what changes were made between the version you sent earlier
and the your current one?

Thanks again,
Amit

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to