aboutsummaryrefslogtreecommitdiff
path: root/internal/syscallcompat
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-05-23 22:54:23 +0200
committerJakob Unterwurzacher2020-05-23 22:54:23 +0200
commit25f1727de9e5681a5ceefe1516a5a01fa4ca624a (patch)
tree3538ced567000b1aabc957fcc686771383bea65e /internal/syscallcompat
parentf8ad2ac3e252108ccfedd115eb3009a5a7d77106 (diff)
syscallcompat: getdents: retry on EINTR
Fixes: https://github.com/rfjakob/gocryptfs/issues/483 Related: https://github.com/golang/go/issues/38836
Diffstat (limited to 'internal/syscallcompat')
-rw-r--r--internal/syscallcompat/getdents_linux.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/syscallcompat/getdents_linux.go b/internal/syscallcompat/getdents_linux.go
index 2674cb3..6cfb033 100644
--- a/internal/syscallcompat/getdents_linux.go
+++ b/internal/syscallcompat/getdents_linux.go
@@ -35,7 +35,13 @@ func getdents(fd int) ([]fuse.DirEntry, error) {
tmp := make([]byte, 10000)
for {
n, err := unix.Getdents(fd, tmp)
- if err != nil {
+ // unix.Getdents has been observed to return EINTR on cifs mounts
+ if err == unix.EINTR {
+ if n > 0 {
+ smartBuf.Write(tmp[:n])
+ }
+ continue
+ } else if err != nil {
return nil, err
}
if n == 0 {