hanwen / go-fuse

FUSE bindings for Go
Other
2.03k stars 324 forks source link

Loopback fs could no be used inside a tree #503

Closed goloveychuk closed 4 weeks ago

goloveychuk commented 6 months ago

Maybe I'm doing smth incorrect, but when I try to render loopback somewhere inside a tree, path is calculated incorrectly, it takes bridge root to calc relative path, but it should take LoopBack root. https://github.com/hanwen/go-fuse/blob/e9e7c22af17af4611b5783a16458647088cc8dec/fs/loopback.go#L88

fix could be to add

func (n *LoopbackNode) Root() *Inode {
    if n.RootData.RootNode != nil {
        return n.RootData.RootNode
    }
    return n.Inode.Root()
}

and replace all inode.Root() usages with loopback.Root(), e.g. https://github.com/hanwen/go-fuse/blob/e9e7c22af17af4611b5783a16458647088cc8dec/fs/loopback.go#L242

goloveychuk commented 6 months ago

fast "fix" https://github.com/hanwen/go-fuse/commit/e0b7bf3018625861e300e69d70b363dd3cc2a73c

hanwen commented 4 weeks ago

612c80e9b0f2eb7495205901747e87889a0bddcf