Skip to content

Commit 531a685

Browse files
committed
fs: fix unconditional FileGetattrer cast
LoopbackNode assumes the passed-in file is a FileGetattrer. This is true in the common case, but not in general. Change-Id: Iff38d6cb80666c3107ffc65b1034b68641a79d21
1 parent 62f3d9a commit 531a685

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/loopback.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ var _ = (NodeGetattrer)((*LoopbackNode)(nil))
364364

365365
func (n *LoopbackNode) Getattr(ctx context.Context, f FileHandle, out *fuse.AttrOut) syscall.Errno {
366366
if f != nil {
367-
return f.(FileGetattrer).Getattr(ctx, out)
367+
if fga, ok := f.(FileGetattrer); ok {
368+
return fga.Getattr(ctx, out)
369+
}
368370
}
369371

370372
p := n.path()

0 commit comments

Comments
 (0)