mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
fix: O_DIRECT is on only for multi-disk setups (#18194)
Disable it for single disk/unsupported platforms
This commit is contained in:
parent
11544a62aa
commit
2b4531f069
@ -290,17 +290,14 @@ func newXLStorage(ep Endpoint, cleanUp bool) (s *xlStorage, err error) {
|
||||
s.formatLegacy = format.Erasure.DistributionAlgo == formatErasureVersionV2DistributionAlgoV1
|
||||
}
|
||||
|
||||
// Return an error if ODirect is not supported unless it is a single erasure
|
||||
// disk mode
|
||||
if err := s.checkODirectDiskSupport(); err == nil {
|
||||
// Return an error if ODirect is not supported. Single disk will have
|
||||
// oDirect off.
|
||||
if globalIsErasureSD || !disk.ODirectPlatform {
|
||||
s.oDirect = false
|
||||
} else if err := s.checkODirectDiskSupport(); err == nil {
|
||||
s.oDirect = true
|
||||
} else {
|
||||
// Allow if unsupported platform or single disk.
|
||||
if errors.Is(err, errUnsupportedDisk) && globalIsErasureSD || !disk.ODirectPlatform {
|
||||
s.oDirect = false
|
||||
} else {
|
||||
return s, err
|
||||
}
|
||||
return s, err
|
||||
}
|
||||
|
||||
// Success.
|
||||
|
Loading…
Reference in New Issue
Block a user