remove rename2 entirely, avoids the risk of moving data (#19058)

This commit is contained in:
Harshavardhana
2024-02-14 17:09:38 -08:00
committed by GitHub
parent b5791e6f28
commit 7e4a6b4bcd
5 changed files with 4 additions and 25 deletions

View File

@@ -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)