if entry is gone, do not try to release the parent
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Mon, 4 Feb 1991 13:46:05 +0000 (05:46 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Mon, 4 Feb 1991 13:46:05 +0000 (05:46 -0800)
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

usr/src/sys/ufs/ffs/ffs_vnops.c
usr/src/sys/ufs/ffs/ufs_vnops.c
usr/src/sys/ufs/lfs/lfs_vnops.c
usr/src/sys/ufs/ufs/ufs_vnops.c

index 2905ae6..0d32449 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ffs_vnops.c 7.50 (Berkeley) %G%
+ *     @(#)ffs_vnops.c 7.51 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1086,10 +1086,13 @@ ufs_rename(fndp, tndp)
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
        } else {
                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
        }
        /*
         * Ensure that the directory entry still exists and has not
index 1521d43..87abfe7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_vnops.c 7.50 (Berkeley) %G%
+ *     @(#)ufs_vnops.c 7.51 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1086,10 +1086,13 @@ ufs_rename(fndp, tndp)
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
        } else {
                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
        }
        /*
         * Ensure that the directory entry still exists and has not
index 00ec85d..9d4d4c2 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)lfs_vnops.c 7.50 (Berkeley) %G%
+ *     @(#)lfs_vnops.c 7.51 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1086,10 +1086,13 @@ ufs_rename(fndp, tndp)
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
        } else {
                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
        }
        /*
         * Ensure that the directory entry still exists and has not
index 1521d43..87abfe7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ufs_vnops.c 7.50 (Berkeley) %G%
+ *     @(#)ufs_vnops.c 7.51 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -1086,10 +1086,13 @@ ufs_rename(fndp, tndp)
                xp = VTOI(fndp->ni_vp);
                dp = VTOI(fndp->ni_dvp);
        } else {
                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
        }
        /*
         * Ensure that the directory entry still exists and has not