diff --git a/cmd/prepare-storage.go b/cmd/prepare-storage.go index c25f1f0e7..edc7d5f8c 100644 --- a/cmd/prepare-storage.go +++ b/cmd/prepare-storage.go @@ -129,6 +129,12 @@ func connectLoadInitFormats(firstDisk bool, endpoints EndpointList, setCount, dr // Attempt to load all `format.json` from all disks. formatConfigs, sErrs := loadFormatXLAll(storageDisks) + // Check if we have + for i, sErr := range sErrs { + if _, ok := formatCriticalErrors[sErr]; ok { + return nil, fmt.Errorf("Disk %s: %s", endpoints[i], sErr) + } + } // Pre-emptively check if one of the formatted disks // is invalid. This function returns success for the @@ -139,12 +145,6 @@ func connectLoadInitFormats(firstDisk bool, endpoints EndpointList, setCount, dr return nil, err } - for i, sErr := range sErrs { - if _, ok := formatCriticalErrors[sErr]; ok { - return nil, fmt.Errorf("Disk %s: %s", endpoints[i], sErr) - } - } - // All disks report unformatted we should initialized everyone. if shouldInitXLDisks(sErrs) && firstDisk { return initFormatXL(context.Background(), storageDisks, setCount, drivesPerSet)