ufs: handle two more cases of possible VNON vnode returned from VFS_VGET().
Reported by: kevans Reviewed by: mckusick, mjg Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D27457
This commit is contained in:
parent
6e5a5dc03d
commit
2c7ada9917
@ -745,6 +745,11 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname *cnp,
|
||||
*vpp = vdp;
|
||||
} else {
|
||||
error = VFS_VGET(pdp->v_mount, ino, cnp->cn_lkflags, &tdp);
|
||||
if (error == 0 && VTOI(tdp)->i_mode == 0) {
|
||||
vgone(tdp);
|
||||
vput(tdp);
|
||||
error = ENOENT;
|
||||
}
|
||||
if (error)
|
||||
return (error);
|
||||
*vpp = tdp;
|
||||
|
@ -240,6 +240,8 @@ ufs_fhtovp(mp, ufhp, flags, vpp)
|
||||
ip = VTOI(nvp);
|
||||
if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen ||
|
||||
ip->i_effnlink <= 0) {
|
||||
if (ip->i_mode == 0)
|
||||
vgone(nvp);
|
||||
vput(nvp);
|
||||
*vpp = NULLVP;
|
||||
return (ESTALE);
|
||||
|
Loading…
Reference in New Issue
Block a user