diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 94d11f291b5..cf7323110bd 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -698,6 +698,10 @@ unionlookup: VOP_ISLOCKED(dp) == LK_SHARED && (cnp->cn_flags & ISLASTCN) && (cnp->cn_flags & LOCKPARENT)) vn_lock(dp, LK_UPGRADE|LK_RETRY); + if ((dp->v_iflag & VI_DOOMED) != 0) { + error = ENOENT; + goto bad; + } /* * If we're looking up the last component and we need an exclusive * lock, adjust our lkflags.