add additional fdatasync before close() on writes (#9947)

This commit is contained in:
Harshavardhana
2020-07-01 10:57:23 -07:00
committed by GitHub
parent 5388ae4acb
commit 174f428571
9 changed files with 134 additions and 42 deletions

View File

@@ -1694,7 +1694,10 @@ func (s *xlStorage) CreateFile(volume, path string, fileSize int64, r io.Reader)
return err
}
defer w.Close()
defer func() {
disk.Fdatasync(w) // Only interested in flushing the size_t not mtime/atime
w.Close()
}()
bufp := s.pool.Get().(*[]byte)
defer s.pool.Put(bufp)