mirror of
https://github.com/minio/minio.git
synced 2025-11-21 18:26:04 -05:00
xl/fs: Bring in ".minio/tmp" directory support. (#1464)
All transactions happen through this directory inside ".minio/temp". Adding this allows us to remove any temporary files which were not committed before. Fixes #1462 Fixes #1444
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
6f1811ee4d
commit
d0e854afb7
16
posix.go
16
posix.go
@@ -741,7 +741,7 @@ func (s fsStorage) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) err
|
||||
log.WithFields(logrus.Fields{
|
||||
"diskPath": s.diskPath,
|
||||
"volume": srcVolume,
|
||||
}).Debugf("getVolumeDir failed with %s", err)
|
||||
}).Errorf("getVolumeDir failed with %s", err)
|
||||
return err
|
||||
}
|
||||
dstVolumeDir, err := s.getVolumeDir(dstVolume)
|
||||
@@ -749,12 +749,20 @@ func (s fsStorage) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) err
|
||||
log.WithFields(logrus.Fields{
|
||||
"diskPath": s.diskPath,
|
||||
"volume": dstVolume,
|
||||
}).Debugf("getVolumeDir failed with %s", err)
|
||||
}).Errorf("getVolumeDir failed with %s", err)
|
||||
return err
|
||||
}
|
||||
if err = os.MkdirAll(path.Join(dstVolumeDir, path.Dir(dstPath)), 0755); err != nil {
|
||||
log.Debug("os.MkdirAll failed with %s", err)
|
||||
log.Errorf("os.MkdirAll failed with %s", err)
|
||||
return err
|
||||
}
|
||||
return os.Rename(path.Join(srcVolumeDir, srcPath), path.Join(dstVolumeDir, dstPath))
|
||||
err = os.Rename(path.Join(srcVolumeDir, srcPath), path.Join(dstVolumeDir, dstPath))
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return errFileNotFound
|
||||
}
|
||||
log.Errorf("os.Rename failed with %s", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user