aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-10-07 22:36:29 +0200
committerJakob Unterwurzacher2016-10-07 22:40:30 +0200
commit53257f4ee57cc59e6638b2a6d8a73203b7d99de5 (patch)
treedd780682ef6daf7d6f6cb5df366fb3ca5573be0b /internal
parent45dfc90a2f96517917baa81829e79e0970ccc421 (diff)
nametransform: better error code on invalid diriv length
go-fuse translates errors unknown to it into "function not implemented", which is wrong in this case.
Diffstat (limited to 'internal')
-rw-r--r--internal/nametransform/diriv.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/nametransform/diriv.go b/internal/nametransform/diriv.go
index 6687b40..0cc8dd3 100644
--- a/internal/nametransform/diriv.go
+++ b/internal/nametransform/diriv.go
@@ -1,7 +1,6 @@
package nametransform
import (
- "errors"
"io/ioutil"
"os"
"path/filepath"
@@ -26,6 +25,7 @@ const (
func ReadDirIV(dir string) (iv []byte, err error) {
fd, err := os.Open(filepath.Join(dir, DirIVFilename))
if err != nil {
+ // Note: getting errors here is normal because of concurrent deletes.
return nil, err
}
defer fd.Close()
@@ -59,7 +59,7 @@ func fdReadDirIV(fd *os.File) (iv []byte, err error) {
iv = iv[0:n]
if len(iv) != DirIVLen {
tlog.Warn.Printf("ReadDirIVAt: wanted %d bytes, got %d", DirIVLen, len(iv))
- return nil, errors.New("invalid iv length")
+ return nil, syscall.EINVAL
}
return iv, nil
}