mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
fix: freezer incorrect fsync ordering so that the temp file fsync happens before the rename
This commit is contained in:
parent
ef0f1f96f9
commit
bc0397fe9f
1 changed files with 5 additions and 0 deletions
|
|
@ -76,6 +76,11 @@ func copyFrom(srcPath, destPath string, offset uint64, before func(f *os.File) e
|
||||||
// we do the final move.
|
// we do the final move.
|
||||||
src.Close()
|
src.Close()
|
||||||
|
|
||||||
|
// Permanently persist the content into disk
|
||||||
|
if err := f.Sync(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if err := f.Close(); err != nil {
|
if err := f.Close(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue