From: Kirk McKusick Date: Mon, 4 Feb 1991 13:46:05 +0000 (-0800) Subject: if entry is gone, do not try to release the parent X-Git-Tag: BSD-4_3_Net_2-Snapshot-Development~1477 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/d9d75b8f74f20e0f43170b709e78e766c99adaf7 if entry is gone, do not try to release the parent SCCS-vsn: sys/ufs/ffs/ffs_vnops.c 7.51 SCCS-vsn: sys/ufs/ffs/ufs_vnops.c 7.51 SCCS-vsn: sys/ufs/lfs/lfs_vnops.c 7.51 SCCS-vsn: sys/ufs/ufs/ufs_vnops.c 7.51 --- diff --git a/usr/src/sys/ufs/ffs/ffs_vnops.c b/usr/src/sys/ufs/ffs/ffs_vnops.c index 2905ae64a4..0d3244914a 100644 --- a/usr/src/sys/ufs/ffs/ffs_vnops.c +++ b/usr/src/sys/ufs/ffs/ffs_vnops.c @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * @(#)ffs_vnops.c 7.50 (Berkeley) %G% + * @(#)ffs_vnops.c 7.51 (Berkeley) %G% */ #include "param.h" @@ -1086,10 +1086,13 @@ ufs_rename(fndp, tndp) xp = VTOI(fndp->ni_vp); dp = VTOI(fndp->ni_dvp); } else { - if (fndp->ni_dvp != NULL) - vput(fndp->ni_dvp); - xp = NULL; - dp = NULL; + /* + * From name has disappeared. + */ + if (doingdirectory) + panic("rename: lost dir entry"); + vrele(ITOV(ip)); + return (0); } /* * Ensure that the directory entry still exists and has not diff --git a/usr/src/sys/ufs/ffs/ufs_vnops.c b/usr/src/sys/ufs/ffs/ufs_vnops.c index 1521d43a46..87abfe72a3 100644 --- a/usr/src/sys/ufs/ffs/ufs_vnops.c +++ b/usr/src/sys/ufs/ffs/ufs_vnops.c @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * @(#)ufs_vnops.c 7.50 (Berkeley) %G% + * @(#)ufs_vnops.c 7.51 (Berkeley) %G% */ #include "param.h" @@ -1086,10 +1086,13 @@ ufs_rename(fndp, tndp) xp = VTOI(fndp->ni_vp); dp = VTOI(fndp->ni_dvp); } else { - if (fndp->ni_dvp != NULL) - vput(fndp->ni_dvp); - xp = NULL; - dp = NULL; + /* + * From name has disappeared. + */ + if (doingdirectory) + panic("rename: lost dir entry"); + vrele(ITOV(ip)); + return (0); } /* * Ensure that the directory entry still exists and has not diff --git a/usr/src/sys/ufs/lfs/lfs_vnops.c b/usr/src/sys/ufs/lfs/lfs_vnops.c index 00ec85d6fd..9d4d4c268c 100644 --- a/usr/src/sys/ufs/lfs/lfs_vnops.c +++ b/usr/src/sys/ufs/lfs/lfs_vnops.c @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * @(#)lfs_vnops.c 7.50 (Berkeley) %G% + * @(#)lfs_vnops.c 7.51 (Berkeley) %G% */ #include "param.h" @@ -1086,10 +1086,13 @@ ufs_rename(fndp, tndp) xp = VTOI(fndp->ni_vp); dp = VTOI(fndp->ni_dvp); } else { - if (fndp->ni_dvp != NULL) - vput(fndp->ni_dvp); - xp = NULL; - dp = NULL; + /* + * From name has disappeared. + */ + if (doingdirectory) + panic("rename: lost dir entry"); + vrele(ITOV(ip)); + return (0); } /* * Ensure that the directory entry still exists and has not diff --git a/usr/src/sys/ufs/ufs/ufs_vnops.c b/usr/src/sys/ufs/ufs/ufs_vnops.c index 1521d43a46..87abfe72a3 100644 --- a/usr/src/sys/ufs/ufs/ufs_vnops.c +++ b/usr/src/sys/ufs/ufs/ufs_vnops.c @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * @(#)ufs_vnops.c 7.50 (Berkeley) %G% + * @(#)ufs_vnops.c 7.51 (Berkeley) %G% */ #include "param.h" @@ -1086,10 +1086,13 @@ ufs_rename(fndp, tndp) xp = VTOI(fndp->ni_vp); dp = VTOI(fndp->ni_dvp); } else { - if (fndp->ni_dvp != NULL) - vput(fndp->ni_dvp); - xp = NULL; - dp = NULL; + /* + * From name has disappeared. + */ + if (doingdirectory) + panic("rename: lost dir entry"); + vrele(ITOV(ip)); + return (0); } /* * Ensure that the directory entry still exists and has not