Author: ivan Date: Fri May 17 13:01:08 2013 New Revision: 1483781 URL: http://svn.apache.org/r1483781 Log: Fix FSFS repository corruption on power or network disk failure on Windows: http://svn.haxx.se/dev/archive-2013-05/0245.shtml
This is revert of r1082451. * subversion/libsvn_subr/io.c (svn_io_write_unique): Perform svn_io_file_flush_to_disk() on all platforms. Modified: subversion/trunk/subversion/libsvn_subr/io.c Modified: subversion/trunk/subversion/libsvn_subr/io.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1483781&r1=1483780&r2=1483781&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_subr/io.c (original) +++ subversion/trunk/subversion/libsvn_subr/io.c Fri May 17 13:01:08 2013 @@ -3472,17 +3472,8 @@ svn_io_write_unique(const char **tmp_pat err = svn_io_file_write_full(new_file, buf, nbytes, NULL, pool); - /* ### BH: Windows doesn't have the race condition between the write and the - ### rename that other operating systems might have. So allow windows - ### to decide when it wants to perform the disk synchronization using - ### the normal file locking and journaling filesystem rules. - - ### Note that this function doesn't handle the rename, so we aren't even - ### sure that we really have to sync. */ -#ifndef WIN32 - if (!err && nbytes > 0) + if (!err) err = svn_io_file_flush_to_disk(new_file, pool); -#endif return svn_error_trace( svn_error_compose_create(err,