Review Request: kio-file: sync file copy to /media/

Davide Bettio davide.bettio at kdemail.net
Fri Jan 22 23:03:05 GMT 2010



> On 2010-01-22 20:41:51, Andras Mantia wrote:
> > Did you profile the copying speed? Are you sure it will not wear out too quickly the USB media? Maybe O_SYNC is better than using full sync mount, but I'd not introduce the change without profiling and testing (a lot) on USB memories.
> 
> Davide Bettio wrote:
>     Next week I will have more free time so I can do some benchmarks. It shouldn't damage flash drives but anyway I will look for more information about that.
>     
>
> 
> Davide Bettio wrote:
>     http://www.westnet.com/~gsmith/content/postgresql/TuningPGWAL.htm
>     Do you think that O_DSYNC might be better?
> 
> David Faure wrote:
>     From man 2 open:
>     
>     POSIX provides for three different variants of synchronized I/O, corresponding to the flags  O_SYNC, O_DSYNC and O_RSYNC. Currently (2.1.130) these are all synonymous under Linux.
> 
> Davide Bettio wrote:
>     The situation might have changed in the meantime (2.1.130 is really old).
>     Anyway the point is if fileSize / MAX_IPC_SIZE updates to the same block (the one which contain the filesize) are acceptable. According to manufacturers flash memories can be written up to 100,000 - 1,000,000 times. Anyway it seems that FAT has no filesize attribute so it will not be an issue on that filesystem.
> 
> Davide Bettio wrote:
>     is it possible to preallocate all the space required by the file which is going to be written without spending time writing zeroes?

ok, I checked documentation again, and FAT has filesize attribute too.


- Davide


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/2690/#review3797
-----------------------------------------------------------


On 2010-01-22 20:42:25, Davide Bettio wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/2690/
> -----------------------------------------------------------
> 
> (Updated 2010-01-22 20:42:25)
> 
> 
> Review request for kdelibs, Kevin Ottens and David Faure.
> 
> 
> Summary
> -------
> 
> This simple patch allows file copy to external devices to be synchronous. This patch assumes that external devices are mounted on a subdirectory of /media/. If /media/ is not used this patch will not work so everything will be as before.
> For more dettails see also https://bugs.kde.org/show_bug.cgi?id=195044.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdelibs/kioslave/file/file_unix.cpp 1077183 
> 
> Diff: http://reviewboard.kde.org/r/2690/diff
> 
> 
> Testing
> -------
> 
> This patch is recent, so I'm testing it right now. kio-file is a critical component so I will do more tests.
> 
> Checking for file corruption might be a good idea:
> dd if=/dev/full of=testFile count=numOfBlocks
> md5sum testFile
> Copy it, umount, mount and check the md5sum.
> 
> 
> Thanks,
> 
> Davide
> 
>





More information about the kde-core-devel mailing list