mirror of
https://github.com/minio/minio.git
synced 2025-03-31 17:53:43 -04:00
fix: check for disk-level O_DIRECT support (#18173)
Disk level O_DIRECT support checking at xl storage initialization was conditional on a config setting being enabled. (This never took effect because config initialization happens after ObjectLayer is ready.) This is not necessary as the config setting is dynamic - O_DIRECT should be enabled via runtime config. So we need to do the disk level support check regardless of the config setting.
This commit is contained in:
parent
1971c54a50
commit
4bda4e4e2b
@ -290,9 +290,8 @@ func newXLStorage(ep Endpoint, cleanUp bool) (s *xlStorage, err error) {
|
|||||||
s.formatLegacy = format.Erasure.DistributionAlgo == formatErasureVersionV2DistributionAlgoV1
|
s.formatLegacy = format.Erasure.DistributionAlgo == formatErasureVersionV2DistributionAlgoV1
|
||||||
}
|
}
|
||||||
|
|
||||||
if globalAPIConfig.odirectEnabled() {
|
// Return an error if ODirect is not supported unless it is a single erasure
|
||||||
// Return an error if ODirect is not supported
|
// disk mode
|
||||||
// unless it is a single erasure disk mode
|
|
||||||
if err := s.checkODirectDiskSupport(); err == nil {
|
if err := s.checkODirectDiskSupport(); err == nil {
|
||||||
s.oDirect = true
|
s.oDirect = true
|
||||||
} else {
|
} else {
|
||||||
@ -303,7 +302,6 @@ func newXLStorage(ep Endpoint, cleanUp bool) (s *xlStorage, err error) {
|
|||||||
return s, err
|
return s, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Success.
|
// Success.
|
||||||
return s, nil
|
return s, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user