-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg/archive.statDifferent(): care about mtime for directories #1962
pkg/archive.statDifferent(): care about mtime for directories #1962
Conversation
2e84a44
to
3e80155
Compare
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>
3e80155
to
8182bef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe, nalind The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
// 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())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is now not making a special case for directories, while the comment still says it does.
Also the sameFsTimeSpec
is now AFAICS happening redundantly twice.
A typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I kept the wrong check there. PR incoming.
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, such as in containers/buildah#5492.