fsck: Detect and fix consistency errors in direct mode mapping files.
This commit is contained in:
parent
4ca9b6bdcf
commit
672f8b5b83
2 changed files with 15 additions and 0 deletions
|
@ -110,6 +110,7 @@ perform key file backend numcopies = check
|
||||||
-- order matters
|
-- order matters
|
||||||
[ fixLink key file
|
[ fixLink key file
|
||||||
, verifyLocationLog key file
|
, verifyLocationLog key file
|
||||||
|
, verifyDirectMapping key file
|
||||||
, checkKeySize key
|
, checkKeySize key
|
||||||
, checkBackend backend key
|
, checkBackend backend key
|
||||||
, checkKeyNumCopies key file numcopies
|
, checkKeyNumCopies key file numcopies
|
||||||
|
@ -258,6 +259,19 @@ verifyLocationLog' key desc present u bad = do
|
||||||
showNote "fixing location log"
|
showNote "fixing location log"
|
||||||
bad s
|
bad s
|
||||||
|
|
||||||
|
{- Ensures the direct mode mapping file is consistent. Each file
|
||||||
|
- it lists for the key should exist, and the specified file should be
|
||||||
|
- included in it.
|
||||||
|
-}
|
||||||
|
verifyDirectMapping :: Key -> FilePath -> Annex Bool
|
||||||
|
verifyDirectMapping key file = do
|
||||||
|
whenM isDirect $ do
|
||||||
|
fs <- addAssociatedFile key file
|
||||||
|
forM_ fs $ \f ->
|
||||||
|
unlessM (liftIO $ doesFileExist f) $
|
||||||
|
void $ removeAssociatedFile key f
|
||||||
|
return True
|
||||||
|
|
||||||
{- The size of the data for a key is checked against the size encoded in
|
{- The size of the data for a key is checked against the size encoded in
|
||||||
- the key's metadata, if available.
|
- the key's metadata, if available.
|
||||||
-
|
-
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -18,6 +18,7 @@ git-annex (3.20130115) UNRELEASED; urgency=low
|
||||||
* Fix direct mode mapping code to always store direct mode filenames
|
* Fix direct mode mapping code to always store direct mode filenames
|
||||||
relative to the top of the repository, even when operating inside a
|
relative to the top of the repository, even when operating inside a
|
||||||
subdirectory.
|
subdirectory.
|
||||||
|
* fsck: Detect and fix consistency errors in direct mode mapping files.
|
||||||
* Avoid filename encoding errors when writing direct mode mappings.
|
* Avoid filename encoding errors when writing direct mode mappings.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Mon, 14 Jan 2013 18:35:01 -0400
|
-- Joey Hess <joeyh@debian.org> Mon, 14 Jan 2013 18:35:01 -0400
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue