From 99ea159fce3fb98080b5e39770fc22b79d58d50f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 Feb 2013 16:54:36 -0400 Subject: add: Improved detection of files that are modified while being added. In indirect mode, now checks the inode cache to detect changes to a file. Note that a file can still be changed if a process has it open for write, after landing in the annex. In direct mode, some checking of the inode cache was done before, but from a much later point, so fewer modifications could be detected. Now it's as good as indirect mode. On crippled filesystems, no lock down is done before starting to add a file, so checking the inode cache is the only protection we have. --- Types/KeySource.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Types') diff --git a/Types/KeySource.hs b/Types/KeySource.hs index 628954c33..fd4af07a6 100644 --- a/Types/KeySource.hs +++ b/Types/KeySource.hs @@ -7,6 +7,8 @@ module Types.KeySource where +import Utility.InodeCache + {- When content is in the process of being added to the annex, - and a Key generated from it, this data type is used. - @@ -16,10 +18,12 @@ module Types.KeySource where - for checking. The migrate command uses the content - of a different Key. - - - + - The inodeCache can be used to detect some types of modifications to + - files that may be made while they're in the process of being added. -} data KeySource = KeySource { keyFilename :: FilePath , contentLocation :: FilePath + , inodeCache :: Maybe InodeCache } deriving (Show) -- cgit v1.2.3