From af4c1fb7a3f428ff704af22294ad955d05ed41dd Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 14 Oct 2020 00:35:16 +0200 Subject: 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 . --- internal/fusefrontend/root_node.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/fusefrontend/root_node.go') diff --git a/internal/fusefrontend/root_node.go b/internal/fusefrontend/root_node.go index 5870c97..e03e250 100644 --- a/internal/fusefrontend/root_node.go +++ b/internal/fusefrontend/root_node.go @@ -203,6 +203,8 @@ func (rn *RootNode) openWriteOnlyFile(dirfd int, cName string, newFlags int) (rw // // openBackingDir is secure against symlink races by using Openat and // ReadDirIVAt. +// +// Retries on EINTR. func (rn *RootNode) openBackingDir(relPath string) (dirfd int, cName string, err error) { dirRelPath := nametransform.Dir(relPath) // With PlaintextNames, we don't need to read DirIVs. Easy. @@ -216,7 +218,7 @@ func (rn *RootNode) openBackingDir(relPath string) (dirfd int, cName string, err return dirfd, cName, nil } // Open cipherdir (following symlinks) - dirfd, err = syscall.Open(rn.args.Cipherdir, syscall.O_DIRECTORY|syscallcompat.O_PATH, 0) + dirfd, err = syscallcompat.Open(rn.args.Cipherdir, syscall.O_DIRECTORY|syscallcompat.O_PATH, 0) if err != nil { return -1, "", err } -- cgit v1.2.3