Hi Amit, Amit Uttamchandani wrote: > On Tue, Sep 03, 2013 at 09:52:55PM +0200, Jean-Pierre André wrote: > > [snip] > > >>> Thanks for the reply. >>> >>> 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. >> >> > Hi, > > Sorry for the long overdue reply. > > I have attached two patches here that I have been using based on your > code. This applies to ntfs-3g-2013.1.13AR.1: > > 1. truncate_solid.patch >
This patch is already included in ntfs-3g-2013.1.13AR.3 http://jp-andre.pagesperso-orange.fr/advanced-ntfs-3g.html#download > 2. ntfs_fallocate.patch > + This adds an fallocate operation to the fuse layer. Of course, > this will need fuse-2.9.2 or higher and a kernel that adds the > fallocate op to the fuse driver. > > Thus, this allows me to call fallocate sys call and have the desired > effect. > I will not release this in its current state, as I do not want to incur leaving the file system in a state which causes Windows to crash. A possible way might be to deallocate unneeded clusters when the file is closed, which is a deviation from Posix. Any other idea ? Regards Jean-Pierre ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk _______________________________________________ ntfs-3g-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel
