xl: Quit early when EC config is incorrect (#16390)

Co-authored-by: Anis Elleuch <anis@min.io>
This commit is contained in:
Anis Elleuch
2023-01-10 08:07:45 +01:00
committed by GitHub
parent 52b88b52f0
commit 2146ed4033
6 changed files with 26 additions and 20 deletions

View File

@@ -304,12 +304,7 @@ func LookupConfig(kvs config.KVS, setDriveCount int) (cfg Config, err error) {
// Validation is done after parsing both the storage classes. This is needed because we need one
// storage class value to deduce the correct value of the other storage class.
if err = validateParity(cfg.Standard.Parity, cfg.RRS.Parity, setDriveCount); err != nil {
cfg.RRS.Parity = defaultRRSParity
if setDriveCount == 1 {
cfg.RRS.Parity = 0
}
cfg.Standard.Parity = DefaultParityBlocks(setDriveCount)
return cfg, err
return Config{}, err
}
return cfg, nil