svn commit: r368393 - head/sys/ufs/ufs
Konstantin Belousov
kib at FreeBSD.org
Sun Dec 6 18:09:15 UTC 2020
Author: kib
Date: Sun Dec 6 18:09:14 2020
New Revision: 368393
URL: https://svnweb.freebsd.org/changeset/base/368393
Log:
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
Modified:
head/sys/ufs/ufs/ufs_lookup.c
head/sys/ufs/ufs/ufs_vfsops.c
Modified: head/sys/ufs/ufs/ufs_lookup.c
==============================================================================
--- head/sys/ufs/ufs/ufs_lookup.c Sun Dec 6 17:45:42 2020 (r368392)
+++ head/sys/ufs/ufs/ufs_lookup.c Sun Dec 6 18:09:14 2020 (r368393)
@@ -745,6 +745,11 @@ found:
*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;
Modified: head/sys/ufs/ufs/ufs_vfsops.c
==============================================================================
--- head/sys/ufs/ufs/ufs_vfsops.c Sun Dec 6 17:45:42 2020 (r368392)
+++ head/sys/ufs/ufs/ufs_vfsops.c Sun Dec 6 18:09:14 2020 (r368393)
@@ -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);
More information about the svn-src-head
mailing list