diff --git a/cmd/xl-storage.go b/cmd/xl-storage.go index 15ee9a9b9..86f14d898 100644 --- a/cmd/xl-storage.go +++ b/cmd/xl-storage.go @@ -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.