mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 11:28:54 +00:00
2218ecd049
The previous code tried to be as efficient as possible and only do a single open() on an item to save, and then fstat() on the fd to find out what the item is (file, dir, other). For normal files, it would then start reading the data without opening the file again, so it could not be exchanged for e.g. a symlink. This behavior starts the watchdog on my machine when /dev is saved with restic, and after a few seconds, the machine reboots. This commit reverts the behavior to the strategy the old archiver code used: run lstat(), then decide what to do. For normal files, open the file and then run fstat() on the fd to verify it's still a normal file, then start reading the data. The downside is that for normal files we now do two stat() calls (lstat+fstat) instead of only one. On the upside, this does not start the watchdog. :) |
||
---|---|---|
.. | ||
archiver_test.go | ||
archiver.go | ||
blob_saver.go | ||
buffer.go | ||
file_saver.go | ||
index_uploader.go | ||
scanner_test.go | ||
scanner.go | ||
testing_test.go | ||
testing.go | ||
tree_saver.go | ||
tree_test.go | ||
tree.go |