diff --git a/src/fscq.hs b/src/fscq.hs index 3f9c93a9..950eb635 100644 --- a/src/fscq.hs +++ b/src/fscq.hs @@ -44,7 +44,8 @@ cachesize = 100000 -- using its own threads). -- Disabled by default: seems to be buggy -- (1) FSCQ no longer terminates gracefully in response to SIGTERM --- (2) More seriously, data doesn't seem to be persisted correctly +-- (2) fuseDestroy (and thus AsyncFS.umount) are not called with opqueue, for +-- unclear reasons useDowncalls :: Bool useDowncalls = False @@ -492,16 +493,22 @@ fscqWrite fr m_fsxp _ inum bs offset = withMVar m_fsxp $ \fsxp -> do (wlen, ()) <- fr $ AsyncFS._AFS__file_get_sz fsxp inum len <- return $ fromIntegral $ wordToNat 64 wlen endpos <- return $ (fromIntegral offset) + (fromIntegral (BS.length bs)) + -- NOTE: logged writes are disabled since they are not crash safe + -- (the design of DFSCQ should permit them to be crash safe, but the proofs + -- don't cover mixing direct and logged writes, and logged writes currently + -- are not synced correctly) (okspc, do_log) <- if len < endpos then do (ok, _) <- fr $ AsyncFS._AFS__file_truncate fsxp inum ((endpos + 4095) `div` 4096) - return (ok, True) + --return (ok, True) + return (ok, False) else do bslen <- return $ fromIntegral $ BS.length bs if ((fromIntegral offset) `mod` 4096 == 0) && (bslen `mod` 4096 == 0) && bslen > 4096 * 5 then -- block is large and aligned -> bypass write return $ (Errno.OK (), False) else - return $ (Errno.OK (), True) + -- return $ (Errno.OK (), True) + return $ (Errno.OK (), False) case okspc of Errno.OK _ -> do r <- foldM (write_piece do_log fsxp len) (WriteOK 0) (compute_range_pieces offset bs)