mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Disable the file zero check in Windows
This commit is contained in:
parent
8a8a3557e9
commit
903ced679f
3 changed files with 9 additions and 3 deletions
6
HISTORY
6
HISTORY
|
|
@ -1,6 +1,12 @@
|
|||
SnapRAID HISTORY
|
||||
================
|
||||
|
||||
9.1 2015/12
|
||||
===========
|
||||
* In Winwdows disables the file zero check requring the --force-zero
|
||||
option. This check is intended for possible case using ext3/4 in Linux,
|
||||
and there is no evidence that in Windows it's possible at all.
|
||||
|
||||
9.0 2015/11
|
||||
===========
|
||||
* Fixes an invalid assumption that could happen when using the
|
||||
|
|
|
|||
3
TODO
3
TODO
|
|
@ -12,9 +12,6 @@ In fact, it makes sense as it's a good way to control the cache on the file,
|
|||
so, despite the name, that usage could be common for not temporary files.
|
||||
https://sourceforge.net/p/snapraid/discussion/1677233/thread/57d40108/
|
||||
|
||||
* Disable the "force-zero" check on Windows. No reason to have it.
|
||||
https://sourceforge.net/p/snapraid/discussion/1677233/thread/88144165/
|
||||
|
||||
* Restore ownership and permissions, at least in Unix.
|
||||
|
||||
* Restore directory timestamps.
|
||||
|
|
|
|||
|
|
@ -862,8 +862,10 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
|
|||
/* because this is slow operation */
|
||||
scan_file_refresh(scan, sub, st, &physical);
|
||||
|
||||
#ifndef _WIN32
|
||||
/* do a safety check to ensure that the common ext4 case of zeroing */
|
||||
/* the size of a file after a crash doesn't propagate to the backup */
|
||||
/* this check is specific for Linux, so we disable it on Windows */
|
||||
if (is_original_file_size_different_than_zero && st->st_size == 0) {
|
||||
if (!state->opt.force_zero) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
@ -877,6 +879,7 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
|
|||
/* LCOV_EXCL_STOP */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* insert it */
|
||||
file = file_alloc(state->block_size, sub, st->st_size, st->st_mtime, STAT_NSEC(st), st->st_ino, physical);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue