Thanks for your feedback and suggestions.
I double checked which vnode_t is returned by my vnop_lookup. It is indeed the one that references both the original file and the hardlink.
vnop_lookup: cat-1235
vnop_lookup: -> lookuprpc(/hlf.txt)
lookuprpc: cat-1235
lookuprpc: lookup successful entry exists
lookuprpc: -> cache_lookup(/hlf.txt)
lookuprpc: <- cache_lookup(/hlf.txt) -> -1 ;VFS_CACHE_HIT
vnop_lookup: <- vp fffffe2a45cf6b60 /hlf.txt
The vnop_open call that comes immediately after the previous vnop_lookup call is for the parent directory, not the file being returned by the previous lookup:
vnop_open: zsh-570
vnop_open: vnode_isdir( root) -> 1
With no open vnop_open calls made afterwards.
Here's a similar backtrace for the original file being looked up.
vnop_lookup: cat-1236
vnop_lookup: -> lookuprpc(/f.txt)
lookuprpc: cat-1236
lookuprpc: lookup successful entry exists
lookuprpc: -> cache_lookup(/f.txt)
lookuprpc: <- cache_lookup(/f.txt) -> -1 ;VFS_CACHE_HIT
vnop_lookup: <- vp fffffe2a45cf6b60 /f.txt
If my vnop_lookup returns the correct vnode_t for the file being looked up, what causes ENOENT to be returned to open(2) in userspace? How do we track it down?
Topic:
App & System Services
SubTopic:
Core OS
Tags: