mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -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
|
s.formatLegacy = format.Erasure.DistributionAlgo == formatErasureVersionV2DistributionAlgoV1
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return an error if ODirect is not supported unless it is a single erasure
|
// Return an error if ODirect is not supported. Single disk will have
|
||||||
// disk mode
|
// oDirect off.
|
||||||
if err := s.checkODirectDiskSupport(); err == nil {
|
if globalIsErasureSD || !disk.ODirectPlatform {
|
||||||
|
s.oDirect = false
|
||||||
|
} else if err := s.checkODirectDiskSupport(); err == nil {
|
||||||
s.oDirect = true
|
s.oDirect = true
|
||||||
} else {
|
} else {
|
||||||
// Allow if unsupported platform or single disk.
|
return s, err
|
||||||
if errors.Is(err, errUnsupportedDisk) && globalIsErasureSD || !disk.ODirectPlatform {
|
|
||||||
s.oDirect = false
|
|
||||||
} else {
|
|
||||||
return s, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success.
|
// Success.
|
||||||
|
Loading…
Reference in New Issue
Block a user