@ -1808,7 +1808,10 @@ func (s *xlStorage) CheckFile(ctx context.Context, volume string, path string) e
st , _ := os . Lstat ( filePath )
if st == nil {
if s . formatLegacy {
if ! s . formatLegacy {
return errPathNotFound
}
filePathOld := pathJoin ( volumeDir , p , xlStorageFormatFileV1 )
if err := checkPathLength ( filePathOld ) ; err != nil {
return err
@ -1819,7 +1822,6 @@ func (s *xlStorage) CheckFile(ctx context.Context, volume string, path string) e
return errPathNotFound
}
}
}
if st != nil {
if ! st . Mode ( ) . IsRegular ( ) {
@ -2110,6 +2112,11 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath, dataDir,
// It is possible that some drives may not have `xl.meta` file
// in such scenarios verify if atleast `part.1` files exist
// to verify for legacy version.
if s . formatLegacy {
// We only need this code if we are moving
// from `xl.json` to `xl.meta`, we can avoid
// one extra readdir operation here for all
// new deployments.
currentDataPath := pathJoin ( dstVolumeDir , dstPath )
entries , err := readDirN ( currentDataPath , 1 )
if err != nil && err != errFileNotFound {
@ -2125,6 +2132,7 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath, dataDir,
}
}
}
}
if legacyPreserved {
// Preserve all the legacy data, could be slow, but at max there can be 10,000 parts.