mirror of
https://github.com/pgsty/minio.git
synced 2026-08-05 07:02:04 +03:00
Avoid removing 'tmp' directory inside '.minio.sys' (#3294)
This commit is contained in:
committed by
Harshavardhana
parent
2c3a2241e7
commit
ffbee70e04
@@ -113,12 +113,12 @@ func writeUploadJSON(u *uploadsV1, uploadsPath, tmpPath string, disk StorageAPI)
|
||||
|
||||
// Write `uploads.json` to disk. First to tmp location and
|
||||
// then rename.
|
||||
if wErr = disk.AppendFile(minioMetaBucket, tmpPath, uplBytes); wErr != nil {
|
||||
if wErr = disk.AppendFile(minioMetaTmpBucket, tmpPath, uplBytes); wErr != nil {
|
||||
return traceError(wErr)
|
||||
}
|
||||
wErr = disk.RenameFile(minioMetaBucket, tmpPath, minioMetaBucket, uploadsPath)
|
||||
wErr = disk.RenameFile(minioMetaTmpBucket, tmpPath, minioMetaBucket, uploadsPath)
|
||||
if wErr != nil {
|
||||
if dErr := disk.DeleteFile(minioMetaBucket, tmpPath); dErr != nil {
|
||||
if dErr := disk.DeleteFile(minioMetaTmpBucket, tmpPath); dErr != nil {
|
||||
// we return the most recent error.
|
||||
return traceError(dErr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user