mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
In check doesn't report as unrecoverable error the missing destination of hardlinks.
This commit is contained in:
parent
33cf866699
commit
6e607ace08
2 changed files with 11 additions and 4 deletions
|
|
@ -430,7 +430,6 @@ endif
|
|||
echo --- Sync after all the fixes
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf sync
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -c $(srcdir)/test-raid6.conf check
|
||||
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-self -v -c $(srcdir)/test-raid6.conf status
|
||||
echo Success!
|
||||
|
||||
# Manual testing
|
||||
|
|
|
|||
14
check.c
14
check.c
|
|
@ -1237,9 +1237,17 @@ close_and_continue:
|
|||
failed = 1;
|
||||
|
||||
if (errno == ENOENT) {
|
||||
/* if the target doesn't exist, it's unrecoverable */
|
||||
unrecoverable = 1;
|
||||
++unrecoverable_error;
|
||||
if (fix) {
|
||||
/* if the target doesn't exist, it's unrecoverable */
|
||||
/* because we cannot create an hardlink of a file that */
|
||||
/* doesn't exists */
|
||||
++unrecoverable_error;
|
||||
} else {
|
||||
/* but in check, we can assume that fixing will recover */
|
||||
/* such missing file, so we assume a less drastic error */
|
||||
++error;
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stdlog, "Error stating hardlink-to '%s'. %s.\n", pathto, strerror(errno));
|
||||
|
|
@ -1524,7 +1532,7 @@ bail:
|
|||
if (unrecoverable_error == 0)
|
||||
return -1;
|
||||
} else if (state->opt.expect_recoverable) {
|
||||
if (error == 0)
|
||||
if (unrecoverable_error != 0 || error == 0)
|
||||
return -1;
|
||||
} else {
|
||||
if (error != 0 || unrecoverable_error != 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue