-
- /* We have a problem. The dvp could have gone away on us while
- * in the unmount path. Thus it appears as VBAD and we cannot
- * use it. If we tried locking the parent (future), for silly
- * rename files, it is unclear where we would lock. The unmount
- * code just pulls unlocked vnodes as it goes thru its list and
- * yanks them. Could unmount be smarter to see if a busy reg vnode has
- * a parent, and not yank it yet? Put in more passes at unmount
- * time? In the meantime, just check if it went away on us.
- * Could have gone away during the nfs_vinvalbuf or ubc_setsize
- * which block. Or perhaps even before nfs_inactive got called.
- */
- if ((sp->s_dvp)->v_type != VBAD)
- nfs_removeit(sp); /* uses the dvp */
+ nfs_removeit(sp);
+ /*
+ * remove nfsnode from hash now so we can't accidentally find it
+ * again if another object gets created with the same filehandle
+ * before this vnode gets reclaimed
+ */
+ LIST_REMOVE(np, n_hash);
+ np->n_flag &= ~NHASHED;