v2api: Getattr: use file handle if passed

This commit is contained in:
Jakob Unterwurzacher 2020-07-12 15:08:17 +02:00
parent 4d99b02279
commit f11432d02a
2 changed files with 6 additions and 0 deletions

View File

@ -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(). // 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) { 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("") dirfd, cName, errno := n.prepareAtSyscall("")
if errno != 0 { if errno != 0 {
return return

View File

@ -72,6 +72,7 @@ func TestMain(m *testing.M) {
} }
test_helpers.ResetTmpDir(!testcase.plaintextnames) test_helpers.ResetTmpDir(!testcase.plaintextnames)
opts := []string{"-zerokey"} opts := []string{"-zerokey"}
//opts = append(opts, "-fusedebug")
opts = append(opts, fmt.Sprintf("-openssl=%v", testcase.openssl)) opts = append(opts, fmt.Sprintf("-openssl=%v", testcase.openssl))
opts = append(opts, fmt.Sprintf("-plaintextnames=%v", testcase.plaintextnames)) opts = append(opts, fmt.Sprintf("-plaintextnames=%v", testcase.plaintextnames))
opts = append(opts, fmt.Sprintf("-aessiv=%v", testcase.aessiv)) opts = append(opts, fmt.Sprintf("-aessiv=%v", testcase.aessiv))