Skip to content

Commit

Permalink
Merge pull request #1874 from wswsmao/main
Browse files Browse the repository at this point in the history
fuse passthrough: fix PassthroughFd return wrong num to go-fuse
  • Loading branch information
ktock authored Nov 25, 2024
2 parents 1ce6fa7 + a0de196 commit efb9325
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/layer/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ func (n *node) Open(ctx context.Context, flags uint32) (fh fusefs.FileHandle, fu
f := &file{
n: n,
ra: ra,
fd: -1,
}

if n.fs.passThrough {
Expand Down Expand Up @@ -473,6 +474,9 @@ func (f *file) Getattr(ctx context.Context, out *fuse.AttrOut) syscall.Errno {
var _ = (fusefs.FilePassthroughFder)((*file)(nil))

func (f *file) PassthroughFd() (int, bool) {
if f.fd <= 0 {
return -1, false
}
return f.fd, true
}

Expand Down

0 comments on commit efb9325

Please sign in to comment.