mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #52125 from yujuhong/fix-file-sync
Automatic merge from submit-queue (batch tested with PRs 52339, 52343, 52125, 52360, 52301) dockershim: check if f.Sync() returns an error and surface it ```release-note dockershim: check the error when syncing the checkpoint. ```
This commit is contained in:
commit
c6a9b1e198
@ -76,7 +76,10 @@ func writeFileAndSync(filename string, data []byte, perm os.FileMode) error {
|
||||
if err == nil && n < len(data) {
|
||||
err = io.ErrShortWrite
|
||||
}
|
||||
f.Sync()
|
||||
if err == nil {
|
||||
// Only sync if the Write completed successfully.
|
||||
err = f.Sync()
|
||||
}
|
||||
if err1 := f.Close(); err == nil {
|
||||
err = err1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user