fix: deletes on older format properly (#10029)

while we handle all situations for writes and reads
on older format, what we didn't cater for properly
yet was delete where we only ended up deleting
just `xl.meta` - instead we should allow all the
deletes to go through for older format without
versioning enabled buckets.
This commit is contained in:
Harshavardhana 2020-07-13 09:01:17 -07:00 committed by GitHub
parent 8d425e3372
commit 1d65ef3201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1100,12 +1100,7 @@ func (s *xlStorage) DeleteVersion(volume, path string, fi FileInfo) error {
if !isXL2V1Format(buf) {
// Delete the meta file, if there are no more versions the
// top level parent is automatically removed.
filePath := pathJoin(volumeDir, path, xlStorageFormatFile)
if err = checkPathLength(filePath); err != nil {
return err
}
return deleteFile(volumeDir, filePath, false)
return deleteFile(volumeDir, pathJoin(volumeDir, path), true)
}
var xlMeta xlMetaV2