Skip to content

Commit

Permalink
pkg/archive.statDifferent(): care about mtime for directories
Browse files Browse the repository at this point in the history
When considering changes, don't ignore differences between directories
when their mtimes are the only thing we check that's changed.  This
creates a difference in behavior between the vfs and overlay drivers
that shows up in build conformance tests.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
  • Loading branch information
nalind committed Jun 7, 2024
1 parent 9ad69c8 commit 3e80155
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/archive/changes_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ func statDifferent(oldStat *system.StatT, oldInfo *FileInfo, newStat *system.Sta
ownerChanged ||
oldStat.Rdev() != newStat.Rdev() ||
oldStat.Flags() != newStat.Flags() ||
!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) ||
// Don't look at size for dirs, its not a good measure of change
(oldStat.Mode()&unix.S_IFDIR != unix.S_IFDIR &&
(!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || (oldStat.Size() != newStat.Size()))) {
(!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || (oldStat.Size() != newStat.Size())) {
return true
}
return false
Expand Down

0 comments on commit 3e80155

Please sign in to comment.