From f11432d02ab8fce306ba85e735b7c3db085f9da6 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 12 Jul 2020 15:08:17 +0200 Subject: v2api: Getattr: use file handle if passed --- internal/fusefrontend/node.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal') 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 -- cgit v1.2.3