mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
remove rename2 entirely, avoids the risk of moving data (#19058)
This commit is contained in:
@@ -2633,13 +2633,6 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath string, f
|
||||
}
|
||||
diskHealthCheckOK(ctx, err)
|
||||
|
||||
if !fi.Versioned && !fi.DataMov() && !fi.Healing() {
|
||||
// Use https://man7.org/linux/man-pages/man2/rename.2.html if possible on unversioned bucket.
|
||||
if err := Rename2(pathutil.Join(srcVolumeDir, srcPath), pathutil.Join(dstVolumeDir, dstPath)); err == nil {
|
||||
return sign, nil
|
||||
} // if Rename2 is not successful fallback.
|
||||
}
|
||||
|
||||
// renameAll only for objects that have xl.meta not saved inline.
|
||||
if len(fi.Data) == 0 && fi.Size > 0 {
|
||||
s.moveToTrash(dstDataPath, true, false)
|
||||
|
||||
Reference in New Issue
Block a user