]> Cypherpunks repositories - gostls13.git/commit
internal/poll: change Fsync to fallback to syscall.Fsync on darwin
authorMauri de Souza Meneguzzo <mauri870@gmail.com>
Thu, 7 Mar 2024 14:37:15 +0000 (14:37 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 7 Mar 2024 19:20:48 +0000 (19:20 +0000)
commitdb44044f75a8b6467c37dd99a944e0021a153e6b
treedddc613887c08de4d849a1788d12e82a5c523c55
parentef4f2a05972f9b729f5edb897d581f496675f588
internal/poll: change Fsync to fallback to syscall.Fsync on darwin

In certain scenarios, such as network mounts, calling Fsync results in
ENOTSUP in OSX. This issue was introduced in CL 130676 since
syscall.FSync was not properly flushing contents to disk, and it was
replaced with fcntl(fd, F_FULLSYNC). Most SMB servers, like Windows
Server and Samba don't support F_FULLSYNC.

To avoid such issues fallback to syscall.Fsync if fcntl returns ENOTSUP.

Fixes #64215

Change-Id: I567191e1179b7e70ddffb6b881469de1872746ef
GitHub-Last-Rev: 62e6931cf79735a192ed57be05005e84720ed232
GitHub-Pull-Request: golang/go#64258
Reviewed-on: https://go-review.googlesource.com/c/go/+/543535
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
src/internal/poll/fd_fsync_darwin.go