omit inode from ContentIdentifier for directory special remote
authorJoey Hess <joeyh@joeyh.name>
Tue, 19 Jan 2021 16:57:15 +0000 (12:57 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 19 Jan 2021 17:15:07 +0000 (13:15 -0400)
commit73df633a6215faa093e4a7524c6d328aa988aed1
treeeaf8af7f87101736adaf490fa48c6b1da28cd02d
parent7ccddd4aea3742df12d4b55dc612c96000e041d6
omit inode from ContentIdentifier for directory special remote

Directory special remotes with importtree=yes now avoid unncessary overhead
when inodes of files have changed, as happens whenever a FAT filesystem
gets remounted.

A few unusual edge cases of modifications won't be detected and
imported. I think they're unusual enough not to be a concern. It would
be possible to add a config setting that controls whether to compare
inodes too, but does not seem worth bothering the user about currently.

I chose to continue to use the InodeCache serialization, just with the
inode zeroed. This way, if I later change my mind or make it
configurable, can parse it back to an InodeCache and operate on it. The
overhead of storing a 0 in the content identifier log seems worth it.

There is a one-time cost to this change; all directory special remotes
with importtree=yes will re-hash all files once, and will update the
content identifier logs with zeroed inodes.

This commit was sponsored by Brett Eisenberg on Patreon.
CHANGELOG
Remote/Directory.hs
Utility/InodeCache.hs
doc/bugs/Directory_remotes_with_same_mount_point/comment_5_fb21865b36819a54a23e1ccb7f377fa1._comment [new file with mode: 0644]
doc/todo/import_tree_from_FAT_does_unncessary_work_due_to_inode_instability.mdwn