tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: vnodes and hard links

On Tue, Apr 19, 2011 at 01:36:36PM -0500, Frank Zerangue wrote:
 > I am confused about what vnode operation vop_lookup_desc should
 > return for two directory entries that refer to the same underling
 > filesystem inode (i.e. hard links).
 > // VNODE(9): There is a unique vnode allocated for each active
 > file, directory, mounted-on file, fifo, domain socket, symbolic
 > link and device."
 > Does this mean that (1) a unique vnode per directory entry or (2) a
 > unique vnode per inode ?

Per inode.

 > I suspect that the answer is (2), but when I do this and just
 > return the already locked vnode, I get this assertion.
 > //   Reader / writer lock error: rw_vector_exit: assertion failed: 
 > RW_COUNT(rw) != 0

Where does this come from? (As in, where's the VOP_UNLOCK it's choking
on?) Is the nmae you're looking up "." or ".."? Are you working on
-current or -5 (or -4)?

 > Examples from other filesystems in the code base either do the same
 > or perform a vget() based some flags, but if the vnode is active it
 > would not be on the free list.

Unfortunately, the locking for lookup is a horrible mess.

David A. Holland

Home | Main Index | Thread Index | Old Index