go-fuse icon indicating copy to clipboard operation
go-fuse copied to clipboard

Loopback fs could no be used inside a tree

Open goloveychuk opened this issue 5 months ago • 1 comments

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 avatar Mar 11 '24 10:03 goloveychuk

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

goloveychuk avatar Mar 12 '24 09:03 goloveychuk