aboutsummaryrefslogtreecommitdiff
path: root/internal/syscallcompat/sys_linux.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-10-14 00:35:16 +0200
committerJakob Unterwurzacher2020-10-14 00:35:16 +0200
commitaf4c1fb7a3f428ff704af22294ad955d05ed41dd (patch)
tree66bdf7480ff1dd82bf2653c2070871762f24d742 /internal/syscallcompat/sys_linux.go
parent803fdf410bb57d34ef09357ec4924646978c20b5 (diff)
syscallcompat: retry ops on EINTR
Retry operations that have been shown to throw EINTR errors on CIFS. Todo: Solution for this pain in the back: warning: unix.Getdents returned errno 2 in the middle of data rm: cannot remove 'linux-3.0.old3/Documentation/ABI/removed': Input/output error Progress towards fixing https://github.com/rfjakob/gocryptfs/issues/483 .
Diffstat (limited to 'internal/syscallcompat/sys_linux.go')
-rw-r--r--internal/syscallcompat/sys_linux.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/syscallcompat/sys_linux.go b/internal/syscallcompat/sys_linux.go
index 6273504..06b9696 100644
--- a/internal/syscallcompat/sys_linux.go
+++ b/internal/syscallcompat/sys_linux.go
@@ -265,9 +265,13 @@ func FutimesNano(fd int, a *time.Time, m *time.Time) (err error) {
}
// UtimesNanoAtNofollow is like UtimesNanoAt but never follows symlinks.
+// Retries on EINTR.
func UtimesNanoAtNofollow(dirfd int, path string, a *time.Time, m *time.Time) (err error) {
ts := timesToTimespec(a, m)
- return unix.UtimesNanoAt(dirfd, path, ts, unix.AT_SYMLINK_NOFOLLOW)
+ err = retryEINTR(func() error {
+ return unix.UtimesNanoAt(dirfd, path, ts, unix.AT_SYMLINK_NOFOLLOW)
+ })
+ return err
}
// Getdents syscall.
@@ -276,6 +280,10 @@ func Getdents(fd int) ([]fuse.DirEntry, error) {
}
// Renameat2 does not exist on Darwin, so we have to wrap it here.
+// Retries on EINTR.
func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) {
- return unix.Renameat2(olddirfd, oldpath, newdirfd, newpath, flags)
+ err = retryEINTR(func() error {
+ return unix.Renameat2(olddirfd, oldpath, newdirfd, newpath, flags)
+ })
+ return err
}