rclone/backend/local
Nick Craig-Wood b91c349cd5 local: fix hash invalidation which caused errors with local crypt mount
Before this fix if a file was updated, but to the same length and
timestamp then the local backend would return the wrong (cached)
hashes for the object.

This happens regularly on a crypted local disk mount when the VFS
thinks files have been changed but actually their contents are
identical to that written previously. This is because when files are
uploaded their nonce changes so the contents of the file changes but
the timestamp and size remain the same because the file didn't
actually change.

This causes errors like this:

    ERROR: file: Failed to copy: corrupted on transfer: md5 crypted
    hash differ "X" vs "Y"

This turned out to be because the local backend wasn't clearing its
cache of hashes when the file was updated.

This fix clears the hash cache for Update and Remove.

It also puts a src and destination in the crypt message to make future
debugging easier.

Fixes #4031
2021-11-24 12:09:34 +00:00
..
about_unix.go Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
about_windows.go Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
fadvise_other.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
fadvise_unix.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
lchtimes_unix.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
lchtimes.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
local_internal_test.go local: fix hash invalidation which caused errors with local crypt mount 2021-11-24 12:09:34 +00:00
local_test.go build: fix up package paths after repo move 2019-07-28 18:47:38 +01:00
local.go local: fix hash invalidation which caused errors with local crypt mount 2021-11-24 12:09:34 +00:00
read_device_other.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
read_device_unix.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
remove_other.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
remove_test.go local: retry remove on Windows sharing violation error #2202 2018-04-07 17:36:26 +01:00
remove_windows.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
symlink_other.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
symlink.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
tests_test.go local: refactor default os encoding out from local backend into shared encoder lib 2021-08-19 20:14:50 +02:00