ostreedev / ostree

Operating system and container binary deployment and upgrades
https://ostreedev.github.io/ostree/
Other
1.26k stars 291 forks source link

Not always zeroing mtime in checkouts #326

Open alexlarsson opened 8 years ago

alexlarsson commented 8 years ago

All mtimes for file objects in bare and bare-user repos are stored with mtime == 0. This means when you check them out with matching mode (i.e. -U with bare-user, nothing with bare) then we hardlink and the checked out file has mtime 0.

However if the modes don't match, or the repo is archive-z2, then we copy the files on checkout, and this does not zero the mtime (although the code explicitly sets mtime 0 on directories, so this only applies to files).

This should be fixed by zeroing the mtime in the copy case too.

cgwalters commented 8 years ago

Yes, although I regret having the silent file copy fallback now. It's silently losing all of the advantages of ostree when one does this.

(Why are you doing it?)

alexlarsson commented 8 years ago

I'm using this (mismatched modes) to explicitly get a copy when using ostree for the build-cache. I.e. I check out a copy.

Long term i want to check out a hardlinked copy and use something like fuse-rofiles, but thats not there yet.

cgwalters commented 8 years ago

Indeed, using fuse-rofiles is the better thing now, at least until we get O_OBJECT or similar.

Mathnerd314 commented 8 years ago

It sounds like there should be ostree checkout --copy in case the hardlinking is not desired. It would be even more useful if it used reflinks on BTRFS.