Allow disks not supporting physical offsets.

This commit is contained in:
Andrea Mazzoleni 2014-06-16 23:12:49 +02:00
parent ea49d5dd4b
commit 05b17e5f0b
3 changed files with 10 additions and 1 deletions

View file

@ -10,6 +10,8 @@ SnapRAID HISTORY
* Auto exclude the lock file.
* Don't prints the 'UUID set' message anymore because it's the normal
condition for empty disks.
* In Windows, if the disk doesn't support reading physical offsets,
allows SnapRAID to continue anyway.
6.2 2014/5
==========

View file

@ -1141,6 +1141,12 @@ int filephy(const char* file, struct stat* st, uint64_t* physical)
/* that it's different from the 0 offset reported by the underline file system */
*physical = FILEPHY_WITHOUT_OFFSET;
CloseHandle(h);
return 0;
} else if (error == ERROR_NOT_SUPPORTED) {
/* for disks shared on network this operation is not supported */
*physical = FILEPHY_UNREPORTED_OFFSET;
CloseHandle(h);
return 0;
} else {

View file

@ -1375,7 +1375,8 @@ void state_scan(struct snapraid_state* state, int output)
if (state->opt.force_order == SORT_PHYSICAL && file->size != 0) {
if (phy_file_last != 0 && file->physical == phy_last && phy_last != FILEPHY_WITHOUT_OFFSET) {
/* if verbose, prints the list of duplicates */
if (state->opt.verbose) {
/* if they are supposed real offsets */
if (state->opt.verbose && phy_last != FILEPHY_UNREPORTED_OFFSET) {
fprintf(stderr, "WARNING! Files '%s%s' and '%s%s' have the same physical offset %"PRId64".\n", disk->dir, phy_file_last->sub, disk->dir, file->sub, phy_last);
}
++phy_dup;