@ -379,6 +379,22 @@ func saveFormatXL(disk StorageAPI, format interface{}) error {
return disk . RenameFile ( minioMetaBucket , formatConfigFileTmp , minioMetaBucket , formatConfigFile )
}
var ignoredHiddenDirectories = [ ] string {
minioMetaBucket ,
"lost+found" ,
"$RECYCLE.BIN" ,
"System Volume Information" ,
}
func isIgnoreHiddenDirectories ( dir string ) bool {
for _ , ignDir := range ignoredHiddenDirectories {
if dir == ignDir {
return true
}
}
return false
}
// loadFormatXL - loads format.json from disk.
func loadFormatXL ( disk StorageAPI ) ( format * formatXLV3 , err error ) {
buf , err := disk . ReadAll ( minioMetaBucket , formatConfigFile )
@ -391,9 +407,7 @@ func loadFormatXL(disk StorageAPI) (format *formatXLV3, err error) {
if err != nil {
return nil , err
}
if len ( vols ) > 1 || ( len ( vols ) == 1 &&
vols [ 0 ] . Name != minioMetaBucket &&
vols [ 0 ] . Name != "lost+found" ) {
if len ( vols ) > 1 || ( len ( vols ) == 1 && ! isIgnoreHiddenDirectories ( vols [ 0 ] . Name ) ) {
// 'format.json' not found, but we
// found user data.
return nil , errCorruptedFormat