diff --git a/lib/mergeset/inmemory_part.go b/lib/mergeset/inmemory_part.go index 058abae8d..a638a410d 100644 --- a/lib/mergeset/inmemory_part.go +++ b/lib/mergeset/inmemory_part.go @@ -56,9 +56,8 @@ func (mp *inmemoryPart) StoreToDisk(path string) error { if err := mp.ph.WriteMetadata(path); err != nil { return fmt.Errorf("cannot store metadata: %w", err) } - // Sync parent directory in order to make sure the written files remain visible after hardware reset - parentDirPath := filepath.Dir(path) - fs.MustSyncPath(parentDirPath) + fs.MustSyncPath(path) + // Do not sync parent directory - it must be synced by the caller. return nil } diff --git a/lib/storage/inmemory_part.go b/lib/storage/inmemory_part.go index 45f3f4eb1..a8c6c3543 100644 --- a/lib/storage/inmemory_part.go +++ b/lib/storage/inmemory_part.go @@ -59,9 +59,8 @@ func (mp *inmemoryPart) StoreToDisk(path string) error { if err := mp.ph.WriteMetadata(path); err != nil { return fmt.Errorf("cannot store metadata: %w", err) } - // Sync parent directory in order to make sure the written files remain visible after hardware reset - parentDirPath := filepath.Dir(path) - fs.MustSyncPath(parentDirPath) + fs.MustSyncPath(path) + // Do not sync parent directory - it must be synced by the caller. return nil }