summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-07-12 15:08:17 +0200
committerJakob Unterwurzacher2020-07-12 15:08:17 +0200
commitf11432d02ab8fce306ba85e735b7c3db085f9da6 (patch)
tree3bda21f8ecea1d45bf7b5576e038167b57aa77d7
parent4d99b02279dce3ef7d37ca219d1305b81f716741 (diff)
v2api: Getattr: use file handle if passed
-rw-r--r--internal/fusefrontend/node.go5
-rw-r--r--tests/matrix/matrix_test.go1
2 files changed, 6 insertions, 0 deletions
diff --git a/internal/fusefrontend/node.go b/internal/fusefrontend/node.go
index 69d9b22..a6272b5 100644
--- a/internal/fusefrontend/node.go
+++ b/internal/fusefrontend/node.go
@@ -87,6 +87,11 @@ func (n *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (ch
//
// GetAttr is symlink-safe through use of openBackingDir() and Fstatat().
func (n *Node) Getattr(ctx context.Context, f fs.FileHandle, out *fuse.AttrOut) (errno syscall.Errno) {
+ // If the kernel gives us a file handle, use it.
+ if f != nil {
+ return f.(fs.FileGetattrer).Getattr(ctx, out)
+ }
+
dirfd, cName, errno := n.prepareAtSyscall("")
if errno != 0 {
return
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go
index 6472aaa..396d15d 100644
--- a/tests/matrix/matrix_test.go
+++ b/tests/matrix/matrix_test.go
@@ -72,6 +72,7 @@ func TestMain(m *testing.M) {
}
test_helpers.ResetTmpDir(!testcase.plaintextnames)
opts := []string{"-zerokey"}
+ //opts = append(opts, "-fusedebug")
opts = append(opts, fmt.Sprintf("-openssl=%v", testcase.openssl))
opts = append(opts, fmt.Sprintf("-plaintextnames=%v", testcase.plaintextnames))
opts = append(opts, fmt.Sprintf("-aessiv=%v", testcase.aessiv))