restic/internal
greatroar a0885d5d69 fuse: Mix inode hashes in a non-symmetric way
Since 0.15 (#4020), inodes are generated as hashes of names, xor'd with
the parent inode. That means that the inode of a/b/b is

	h(a/b/b) = h(a) ^ h(b) ^ h(b) = h(a).

I.e., the grandchild has the same inode as the grandparent. GNU find
trips over this because it thinks it has encountered a loop in the
filesystem, and fails to search a/b/b. This happens more generally when
the same name occurs an even number of times.

Fix this by multiplying the parent by a large prime, so the combining
operation is not longer symmetric in its arguments. This is what the FNV
hash does, which we used prior to 0.15. The hash is now

	h(a/b/b) = h(b) ^ p*(h(b) ^ p*h(a))

Note that we already ensure that h(x) is never zero.

Collisions can still occur, but they should be much less likely to occur
within a single path.

Fixes #4253.
2023-03-21 17:33:18 +01:00
..
archiver Merge pull request #4089 from greatroar/errors 2022-12-24 10:41:56 +01:00
backend Merge pull request #4089 from greatroar/errors 2022-12-24 10:41:56 +01:00
bloblru bloblru: Upgrade to hashicorp/golang-lru/v2 2022-11-27 17:18:13 +01:00
cache cache: Replace readCloser+LimitedReader by backend.LimitedReadCloser 2023-01-03 19:03:36 +01:00
checker Merge pull request #4089 from greatroar/errors 2022-12-24 10:41:56 +01:00
crypto crypto: move crypto buffer helpers 2022-07-17 13:42:23 +02:00
debug Replace most usages of ioutil with the underlying function 2022-12-02 19:36:43 +01:00
dump convert uid/gid -1 to 0 only in 32-bit tar dump 2022-12-30 18:12:12 +01:00
errors errors: Drop WithMessage 2022-10-14 14:06:47 +02:00
filter remove no longer necessary conditional compiles 2022-11-27 13:18:44 +01:00
fs all: Replace some errors.Wrap calls by errors.WithStack 2022-12-17 09:41:07 +01:00
fuse fuse: Mix inode hashes in a non-symmetric way 2023-03-21 17:33:18 +01:00
hashing Replace most usages of ioutil with the underlying function 2022-12-02 19:36:43 +01:00
index repository: Reuse buffers in Repository.LoadUnpacked 2023-01-30 22:01:01 +01:00
migrations repository: Remove empty cleanup functions in tests 2022-12-11 11:06:25 +01:00
options backend, options: Prefer strings.Cut to SplitN 2022-12-02 19:19:14 +01:00
pack repository: optimize MasterIndex.Each 2022-09-24 12:21:59 +02:00
repository repository: Reuse buffers in Repository.LoadUnpacked 2023-01-30 22:01:01 +01:00
restic cmd, restic: Refactor and fix snapshot filtering 2023-02-19 15:04:25 +01:00
restorer Merge pull request #4089 from greatroar/errors 2022-12-24 10:41:56 +01:00
selfupdate self-update: add basic test for extractToFile 2023-01-22 15:39:42 +01:00
test test: Use testing.T.Cleanup to remove tempdirs 2022-12-09 14:23:55 +01:00
textfile Replace most usages of ioutil with the underlying function 2022-12-02 19:36:43 +01:00
ui ui/backup: Fix percent and eta in backup progress 2023-01-21 13:25:08 -07:00
walker rewrite: Fail if a tree contains an unknown field 2022-11-12 19:55:22 +01:00