summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-03-09 13:33:13 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-03-09 13:33:13 -0400
commit0e37e9778f38bfec13fb8bbd2f5e1e3323179fe4 (patch)
treec795773d7f5e54a2838312362b721107f7049d55
parent11d0943415cc2267776c701b79e5b4e8a13b1792 (diff)
Always try to thaw content, even when annex.crippledfilesystem is set.
-rw-r--r--Annex/Content.hs9
-rw-r--r--Annex/Perms.hs11
-rw-r--r--debian/changelog1
-rw-r--r--doc/bugs/git-annex:_failed_to_lock_content.mdwn2
-rw-r--r--doc/bugs/git-annex:_failed_to_lock_content/comment_6_ced3c56607762562c1d21fd821d7c779._comment11
5 files changed, 30 insertions, 4 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index 103fa264d..d14e87adc 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -951,8 +951,13 @@ chmodContent file = unlessM crippledFileSystem $
{- Allows writing to an annexed file that freezeContent was called on
- before. -}
thawContent :: FilePath -> Annex ()
-thawContent file = unlessM crippledFileSystem $
- withShared go
+thawContent file = ifM crippledFileSystem
+ -- Probably cannot change mode on crippled filesystem,
+ -- but if file modes are supported, the content may be frozen
+ -- so try to thaw it.
+ ( void $ tryNonAsync $ withShared go
+ , withShared go
+ )
where
go GroupShared = liftIO $ groupWriteRead file
go AllShared = liftIO $ groupWriteRead file
diff --git a/Annex/Perms.hs b/Annex/Perms.hs
index 159cc328a..3905b7af9 100644
--- a/Annex/Perms.hs
+++ b/Annex/Perms.hs
@@ -92,8 +92,15 @@ freezeContentDir file = unlessM crippledFileSystem $
go _ = liftIO $ preventWrite dir
thawContentDir :: FilePath -> Annex ()
-thawContentDir file = unlessM crippledFileSystem $
- liftIO $ allowWrite $ parentDir file
+thawContentDir file = ifM crippledFileSystem
+ -- Probably cannot change mode on crippled filesystem,
+ -- but if file modes are supported, the directory may be frozen,
+ -- so try to thaw it.
+ ( void $ tryNonAsync go
+ , go
+ )
+ where
+ go = liftIO $ allowWrite $ parentDir file
{- Makes the directory tree to store an annexed file's content,
- with appropriate permissions on each level. -}
diff --git a/debian/changelog b/debian/changelog
index fe8d0cb1a..fc01dbdaf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ git-annex (6.20160230) UNRELEASED; urgency=medium
* dropkey: Add --batch and --json.
* Fix OSX dmg to include libraries needed by bundled gpg,
lost in last release.
+ * Always try to thaw content, even when annex.crippledfilesystem is set.
-- Joey Hess <id@joeyh.name> Mon, 29 Feb 2016 13:00:30 -0400
diff --git a/doc/bugs/git-annex:_failed_to_lock_content.mdwn b/doc/bugs/git-annex:_failed_to_lock_content.mdwn
index f383f30ff..f036f1353 100644
--- a/doc/bugs/git-annex:_failed_to_lock_content.mdwn
+++ b/doc/bugs/git-annex:_failed_to_lock_content.mdwn
@@ -103,3 +103,5 @@ Could the problem have something to do with the file having permission 0444 and
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
Been using it since your kickstarter campaign!
+
+> [[done]] --[[Joey]]
diff --git a/doc/bugs/git-annex:_failed_to_lock_content/comment_6_ced3c56607762562c1d21fd821d7c779._comment b/doc/bugs/git-annex:_failed_to_lock_content/comment_6_ced3c56607762562c1d21fd821d7c779._comment
new file mode 100644
index 000000000..cebc1f0c1
--- /dev/null
+++ b/doc/bugs/git-annex:_failed_to_lock_content/comment_6_ced3c56607762562c1d21fd821d7c779._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 6"""
+ date="2016-03-09T17:31:18Z"
+ content="""
+Ok, I managed to get a vfat that honors file perms with those mount
+options.
+
+I'm going to make git-annex always try to chmod the file, even if it's on a
+crippled filesystem. That should solve it.
+"""]]