aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/man/man9/VOP_RENAME.933
1 files changed, 6 insertions, 27 deletions
diff --git a/share/man/man9/VOP_RENAME.9 b/share/man/man9/VOP_RENAME.9
index 2d8b4508bc85..4c2e58a65a3c 100644
--- a/share/man/man9/VOP_RENAME.9
+++ b/share/man/man9/VOP_RENAME.9
@@ -104,34 +104,13 @@ vop_rename(struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp,
}
/*
- * Check if just deleting a link name.
+ * POSIX: "If the old argument and the new argument
+ * both refer to links to the same existing file,
+ * the rename() function shall return successfully
+ * and perform no other action."
+ * The upper layers already handle this case.
*/
- if (fvp == tvp) {
- if (fvp->v_type == VDIR) {
- error = EINVAL;
- goto abortit;
- }
-
- /*
- * Release destination.
- */
- vput(tdvp);
- vput(tvp);
-
- /*
- * Delete source. Pretty bizarre stuff.
- */
- vrele(fdvp);
- vrele(fvp);
- fcnp->cn_flags &= ~MODMASK;
- fcnp->cn_flags |= LOCKPARENT | LOCKLEAF;
- fcnp->cn_nameiop = DELETE;
- VREF(fdvp);
- error = relookup(fdvp, &fvp, fcnp);
- if (error == 0)
- vrele(fdvp);
- return VOP_REMOVE(fdvp, fvp, fcnp);
- }
+ KASSERT(fvp != tvp, ("vop_rename: source and destination are the same"));
if (fvp is immutable) {
error = EPERM;