From: Joey Hess Date: Tue, 27 Jul 2021 21:34:56 +0000 (-0400) Subject: use SQL.addInodeCaches X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~2^2^2~69^2~24 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a30656037459b4006ba6ec12bd1cb4e705d04ea8;p=git-annex.git use SQL.addInodeCaches This avoids deadlock when opening the database handle calls reconcileStaged. --- diff --git a/Database/Keys.hs b/Database/Keys.hs index d7bd619504..04fef03d2a 100644 --- a/Database/Keys.hs +++ b/Database/Keys.hs @@ -384,10 +384,14 @@ reconcileStaged qh = do ics <- liftIO $ SQL.getInodeCaches key (SQL.ReadHandle qh) obj <- calcRepo (gitAnnexLocation key) mobjic <- withTSDelta (liftIO . genInodeCache obj) + let addinodecaches k v = liftIO $ + SQL.addInodeCaches k v (SQL.WriteHandle qh) -- Like inAnnex, check the annex object is unmodified -- when annex.thin is set. keypopulated <- ifM (annexThin <$> Annex.getGitConfig) - ( maybe (pure False) (\objic -> isUnmodifiedLowLevel addInodeCaches key obj objic ics) mobjic + ( case mobjic of + Just objic -> isUnmodifiedLowLevel addinodecaches key obj objic ics + Nothing -> pure False , pure (isJust mobjic) ) p <- fromRepo $ fromTopFilePath file @@ -396,10 +400,8 @@ reconcileStaged qh = do (True, False) -> populatePointerFile (Restage True) key obj p >>= \case Nothing -> return () - Just ic -> liftIO $ - SQL.addInodeCaches key - (catMaybes [Just ic, mobjic]) - (SQL.WriteHandle qh) + Just ic -> addinodecaches key + (catMaybes [Just ic, mobjic]) (False, True) -> depopulatePointerFile key p _ -> return ()