dirstate validator includes ctime so is broken by hardlinking

Bug #741515 reported by Martin Pool
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

From Aaron's post in the current bzr-colo thread <http://bazaar.2286606.n4.nabble.com/Re-rfc-bzr-colo-into-core-tp3395197p3401187.html>

The current bzr dirstate validator includes the file ctime (on posix).

This which means the saved hash will be invalidated when a file is hardlinked, which somewhat defeats the benefit of hardlinking. (We could possibly update the tree at the same time we copy it.)

If we didn't include the ctime, it'd be possible for the user to 'fool' bzr by for example 'cp -p' of a file into the tree that has the exact same mtime and size into the tree. I don't know if that really matters.

We could even put in an option to change this.

Revision history for this message
John A Meinel (jameinel) wrote :

We use ctime to warn us that we need to check the mode, I think. But I can see your point that we already have mode when we do the stat, so we don't need to use it as a second check.

Martin Pool (mbp)
summary: - dirstate validator includes ctime
+ dirstate validator includes ctime so is broken by hardlinking
description: updated
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.