drivers.ChownPathByMaps(): preserve directory ModTimes#880
Conversation
298e936 to
9027558
Compare
|
Tests with fuse-overlayfs appear to be stumbling on containers/fuse-overlayfs#400. Do we need to skip the new tests in that configuration? |
ce8d36f to
8ef9805
Compare
|
Packit jobs failed. @containers/packit-build please check. |
| tsCurrent := syscall.NsecToTimespec(st.ModTime().UnixNano()) | ||
| tsSaved := syscall.NsecToTimespec(value.(int64)) | ||
| if tsCurrent != tsSaved { | ||
| if err := system.LUtimesNano(dir, []syscall.Timespec{tsSaved, tsSaved}); err != nil { |
There was a problem hiding this comment.
This is not supported on macOS, which the code otherwise seems to support.
There was a problem hiding this comment.
Since tests are suggesting that we don't have to touch every directory, I've dropped the bits in chown_darwin.go that added entries to modifiedDirectories, so the loop should not be entered except on systems where chown_unix.go is doing a remove+link.
There was a problem hiding this comment.
Okay, adding that back in in chown_unix.go because we flaked on btrfs. I guess that's to be expected?
8ef9805 to
3ca0c9a
Compare
|
|
||
| // Deprecated: Use lockfile.*LockFile. | ||
| type Locker = lockfile.Locker //nolint:staticcheck // SA1019 lockfile.Locker is deprecated | ||
| type Locker = lockfile.Locker |
There was a problem hiding this comment.
There’s some kind of long-standing caching(?) issue. AFAICT the code is correct as is, it’s ”trigger another run and hope it works this time”… Podman is running into a fair bit, it’s quite new for container-libs.
There was a problem hiding this comment.
Good to know, I'll drop that commit when I push this next.
6a9f8d2 to
f731efb
Compare
When changing the ownership throughout a directory tree, make notes of the initial values of the ModTime for directories that we process. When removing and re-creating hard links to pick up an ownership change, or changing the owner of an directory, note the name of the directory containing the hard link, or of the directory itself. After changing the ownership throughout a directory tree, walk the list of directories whose timestamps we expect to have modified, and if their ModTime values were changed, restore them. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
f731efb to
ba14a36
Compare
When changing the ownership throughout a directory tree, make notes of the initial values of the ModTime for directories that we process.
When removing and re-creating hard links to pick up an ownership change, or changing the owner of an directory, note the name of the directory containing the hard link.
After changing the ownership throughout a directory tree, walk the list of directories whose timestamps we expect to have modified, and if their ModTime values were changed, restore them.