checksum-directory does not re-use checksums from olddirs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu CD Images |
Triaged
|
High
|
Łukasz Zemczak |
Bug Description
The bin/checksum-
The checksum-directory merging of checksums works in such a way that each entry in the current directory is checked to see if it can be re-used from one of the olddirs. First there's a check for symlinks. If the entry is not a symlink, then the next method of 'checking' is checking the timestamps of the files against the checksum-storage files. The current design of the timestamp checking makes it basically impossible to re-use checksums from other directories though.
Each image file is checked for max(st.st_mtime, st.st_ctime) and then compared with the old directory's checksums file (for instance, MD5SUMS) mtime (entry_time > dir_time). Every move, hard-link or copy operation of an image file modifies at least one of the timestamps (usually st_ctime), resulting in checksum-directory not considering re-using the checksum. I think only mtime should be checked?
Related branches
- Steve Langasek: Approve
-
Diff: 11 lines (+1/-1)1 file modifiedlib/cdimage/checksums.py (+1/-1)
Changed in ubuntu-cdimage: | |
status: | In Progress → Triaged |
I'd like to know if we're actually using the olddirs functionality right now, other than for removing old releases. Once we know that, I would propose using only st.st_mtime for the timestamp check. Checksums only care about the *contents* of the image, not the metadata. Move and link operations will only touch the st_ctime timestamp, so it would allow re-using the checksums in cases of image moves. Also, image moves and hard-links should be fairly safe.
I'll prepare a PR but leave it open for discussion.