fs: detect Inode.Path() hitting an orphaned inode
Some ".deleted" logic was in place, but did not work properly when the Inode was in the root directory. Fix that by introducing the `found` variable and add a test that verifies that it works. Also, return `.go-fuse.$RANDOM/deleted` to make it very unlikely that the placeholder name matches an actual file or directory. Introducing the `/deleted` subdir makes sure operations creating a file or directory fail reliably with ENOENT. Tests now look like this: $ go test ./fs -run TestPosix/RenameOpenDir -count 1 -v === RUN TestPosix === RUN TestPosix/RenameOpenDir [...] --- PASS: TestPosix (0.01s) --- SKIP: TestPosix/RenameOpenDir (0.01s) test.go:383: Fstat failed: no such file or directory. Known limitation - see https://github.com/hanwen/go-fuse/issues/55 PASS ok github.com/hanwen/go-fuse/v2/fs 0.014s Change-Id: I2eb6fd48a11df543c9b7daf62647cb9d8a892568
Showing
Please register or sign in to comment