Skip to content

Commit 1f1654c

Browse files
committed
Open disk in O_DIRECT mode when writing
1 parent 5817922 commit 1f1654c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

diskfs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ func (m OpenModeOption) String() string {
158158

159159
var openModeOptions = map[OpenModeOption]int{
160160
ReadOnly: os.O_RDONLY,
161-
ReadWriteExclusive: os.O_RDWR | os.O_EXCL,
162-
ReadWrite: os.O_RDWR,
161+
ReadWriteExclusive: os.O_RDWR | os.O_EXCL | os.O_DIRECT,
162+
ReadWrite: os.O_RDWR | os.O_DIRECT,
163163
}
164164

165165
// SectorSize represents the sector size to use

0 commit comments

Comments
 (0)