diff --git a/changelog/unreleased/issue-3720 b/changelog/unreleased/issue-3720 new file mode 100644 index 000000000..3044a5c4c --- /dev/null +++ b/changelog/unreleased/issue-3720 @@ -0,0 +1,13 @@ +Bugfix: Fix directory sync errors related repositories accessed via SMB + +On Linux and macOS accessing a repository via a SMB/CIFS mount resulted in +restic failing to save the lock file: + +Save() returned error, retrying after 552.330144ms: sync /repo/locks: no such file or directory +Save() returned error, retrying after 552.330144ms: sync /repo/locks: invalid argument + +This has been fixed by ignoring these error codes. + +https://github.com/restic/restic/issues/3720 +https://github.com/restic/restic/issues/3751 +https://github.com/restic/restic/pull/3752 diff --git a/internal/backend/local/local_unix.go b/internal/backend/local/local_unix.go index 6e1298796..3dde753a8 100644 --- a/internal/backend/local/local_unix.go +++ b/internal/backend/local/local_unix.go @@ -19,7 +19,7 @@ func fsyncDir(dir string) error { } err = d.Sync() - if errors.Is(err, syscall.ENOTSUP) { + if errors.Is(err, syscall.ENOTSUP) || errors.Is(err, syscall.ENOENT) || errors.Is(err, syscall.EINVAL) { err = nil }