fix: New disks healing should pick unformatted disks as well (#13054) (#13620)

A recent regression caused new disks not being re-formatted. In the old
code, a disk needed be 'online' to be chosen to be formatted but the
disk has to be already formatted for XL storage IsOnline() function to
return true.

It is enough to check if XL storage is nil or not if we want to avoid
formatting root disks.

Co-authored-by: Anis Elleuch <anis@min.io>

Co-authored-by: Anis Elleuch <anis@min.io>
This commit is contained in:
Anis Elleuch 2021-11-09 19:26:07 +01:00 committed by GitHub
parent a3c36595a0
commit d4ae7d5e62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -705,7 +705,7 @@ func saveUnformattedFormat(ctx context.Context, storageDisks []StorageAPI, forma
if format == nil {
continue
}
if storageDisks[index] != nil && storageDisks[index].IsOnline() {
if storageDisks[index] != nil {
if err := saveFormatErasure(storageDisks[index], format, true); err != nil {
return err
}