diff --git a/cmd/xl-storage_noatime_notsupported.go b/cmd/xl-storage_noatime_notsupported.go index ac6718ef6..c9c91d624 100644 --- a/cmd/xl-storage_noatime_notsupported.go +++ b/cmd/xl-storage_noatime_notsupported.go @@ -1,5 +1,4 @@ -//go:build windows || darwin || freebsd -// +build windows darwin freebsd +//go:build !unix || darwin || freebsd // Copyright (c) 2015-2021 MinIO, Inc. // diff --git a/cmd/xl-storage_noatime_supported.go b/cmd/xl-storage_noatime_supported.go index eefeef87c..efa75ff0a 100644 --- a/cmd/xl-storage_noatime_supported.go +++ b/cmd/xl-storage_noatime_supported.go @@ -1,5 +1,4 @@ -//go:build !windows && !darwin && !freebsd -// +build !windows,!darwin,!freebsd +//go:build unix && !darwin && !freebsd // Copyright (c) 2015-2021 MinIO, Inc. // @@ -22,12 +21,14 @@ package cmd import ( "os" + "syscall" ) var ( // Disallow updating access times - readMode = os.O_RDONLY | 0x40000 // O_NOATIME + // Add non-block to avoid syscall to attempt to set epoll on files. + readMode = os.O_RDONLY | 0x40000 | syscall.O_NONBLOCK // O_NOATIME // Write with data sync only used only for `xl.meta` writes - writeMode = 0x1000 // O_DSYNC + writeMode = 0x1000 | syscall.O_NONBLOCK // O_DSYNC )