Skip to content

Commit

Permalink
fuse passthrough: fix PassthroughFd return wrong num in no passthroug…
Browse files Browse the repository at this point in the history
…h model

Signed-off-by: abushwang <[email protected]>
  • Loading branch information
wswsmao committed Nov 25, 2024
1 parent 1ce6fa7 commit a0de196
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 a0de196

Please sign in to comment.