From 76e365769eb2c4344fbef78a26c386fec1ad14da Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Jan 2022 14:00:19 -0400 Subject: [PATCH] fix crash after drop in v10 After cleaning up the lock file, the content directory is gone, so freezing it failed. Sponsored-by: Dartmouth College's Datalad project --- Annex/Content.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Annex/Content.hs b/Annex/Content.hs index 4895b9b182..ccec9e8313 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -243,8 +243,8 @@ lockContentUsing contentlocker key fallback a = withContentLockFile key $ \mlock cleanuplockfile lockfile liftIO $ dropLock h -- We have an exclusive lock, so no other process can have - -- the file locked, and so it's safe to remove it, as long - -- as all attempts to lock the file use checkSaneLock. + -- the lock file locked, and so it's safe to remove it, as + -- long as all lock attempts use checkSaneLock. _ -> do maybe noop cleanuplockfile mlockfile liftIO $ dropLock lck @@ -258,10 +258,10 @@ lockContentUsing contentlocker key fallback a = withContentLockFile key $ \mlock maybe noop cleanuplockfile mlockfile #endif - cleanuplockfile lockfile = modifyContent lockfile $ - void $ liftIO $ tryIO $ do - removeWhenExistsWith R.removeLink lockfile - cleanObjectDirs lockfile + cleanuplockfile lockfile = void $ tryNonAsync $ do + thawContentDir lockfile + liftIO $ removeWhenExistsWith R.removeLink lockfile + liftIO $ cleanObjectDirs lockfile {- Runs an action, passing it the temp file to get, - and if the action succeeds, verifies the file matches