fuse icon indicating copy to clipboard operation
fuse copied to clipboard

Trouble with GenerateInode

Open KyleSanderson opened this issue 4 years ago • 1 comments

Not entirely sure what's going on. I can see GenerateInode being invoked but the inodes are not assigned.

I wrote a cheaper function to try and get some generation going, and while it prints: ls -i and similar don't return the dynamic inode value. Hard coding this in GetAttr results in the behaviour expected, with the caveat I'm not holding onto the parent inode values to augment this.

func (f *FS) GenerateInode(parentInode uint64, name string) uint64 {
	fmt.Printf("PI: %d | GI: %d | %s\n", parentInode, uint64((parentInode & 0x00000000FFFFFFFF) << 32) | uint64(crc32.ChecksumIEEE([]byte(name))), name)
	return uint64(uint64(crc32.ChecksumIEEE([]byte(name)))
}

KyleSanderson avatar Apr 05 '21 00:04 KyleSanderson

I think the next step is to add tests for GenerateInode, it seems I never got around to do that.

tv42 avatar Apr 07 '21 15:04 tv42

I wrote a unit test for GenerateInode in commit ac2adf203b6787dd54f98a7d05456aad3444bbd6 and it seems to work just fine. Please provide more information, ideally a small filesystem implementation that demonstrates the issue.

tv42 avatar Dec 09 '22 19:12 tv42