fix: incorrect O_DIRECT behavior for reads (#12811)

O_DIRECT behavior was broken and it was still
caching all the reads, this change properly fixes
this behavior.
This commit is contained in:
Harshavardhana
2021-07-28 11:20:16 -07:00
committed by GitHub
parent 397637a042
commit bfbdb8f0a8
4 changed files with 13 additions and 69 deletions

View File

@@ -30,8 +30,6 @@ import (
"strings"
"syscall"
"testing"
"github.com/minio/minio/internal/config/storageclass"
)
func TestCheckPathLength(t *testing.T) {
@@ -1152,10 +1150,6 @@ func TestXLStorageReadFile(t *testing.T) {
}
for l := 0; l < 2; l++ {
// 1st loop tests with dma=write, 2nd loop tests with dma=read-write.
if l == 1 {
globalStorageClass.DMA = storageclass.DMAReadWrite
}
// Following block validates all ReadFile test cases.
for i, testCase := range testCases {
var n int64
@@ -1213,9 +1207,6 @@ func TestXLStorageReadFile(t *testing.T) {
}
}
// Reset the flag.
globalStorageClass.DMA = storageclass.DMAWrite
// TestXLStorage for permission denied.
if runtime.GOOS != globalWindowsOSName {
permDeniedDir := createPermDeniedFile(t)