restic / rest-server

Rest Server is a high performance HTTP server that implements restic's REST backend API.
BSD 2-Clause "Simplified" License
922 stars 138 forks source link

Ignore fsync errors #199

Closed MichaelEischer closed 1 year ago

MichaelEischer commented 1 year ago

What is the purpose of this change? What does it change?

Storing a repository on a filesystem that does not support fsync is currently not possible. This PR syncs the ignored fsync errors from the restic backend to also allow storing a repository on these filesystems. However, this is not recommended as without fsync it is not possible to guarantee the integrity of uploaded data.

In addition, macOS Ventura seems to have introduced an additional error code, see #198.

Was the change discussed in an issue or in the forum before?

Fixes #198.

Checklist

MichaelEischer commented 1 year ago

I've replaced the implementation in the PR with the changes made for restic in https://github.com/restic/restic/pull/4021 . The fsync handling is now largely copy & paste from restic, which should make it easier to maintain this error handling mess.

bdillahu commented 1 year ago

For what it's worth, it works for me as I was having the errors.