mirror of
https://github.com/minio/minio.git
synced 2025-03-29 00:33:42 -04:00
when o_direct is disabled do not attempt fadvise call (#14230)
This commit is contained in:
parent
67d07e895c
commit
24657859a8
@ -1715,7 +1715,11 @@ func (s *xlStorage) ReadFileStream(ctx context.Context, volume, path string, off
|
|||||||
}{Reader: io.LimitReader(or, length), Closer: closeWrapper(func() error {
|
}{Reader: io.LimitReader(or, length), Closer: closeWrapper(func() error {
|
||||||
if !alignment || offset+length%xioutil.DirectioAlignSize != 0 {
|
if !alignment || offset+length%xioutil.DirectioAlignSize != 0 {
|
||||||
// invalidate page-cache for unaligned reads.
|
// invalidate page-cache for unaligned reads.
|
||||||
disk.FadviseDontNeed(file)
|
if !globalAPIConfig.isDisableODirect() {
|
||||||
|
// skip removing from page-cache only
|
||||||
|
// if O_DIRECT was disabled.
|
||||||
|
disk.FadviseDontNeed(file)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return or.Close()
|
return or.Close()
|
||||||
})}
|
})}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user