--- vfs_syscalls.c.orig 2008-09-01 11:49:18.175215007 +0200 +++ vfs_syscalls.c 2008-09-01 11:47:30.593200533 +0200 @@ -3583,26 +3583,28 @@ tvfslocked = NDHASGIANT(&tond); tdvp = tond.ni_dvp; tvp = tond.ni_vp; if (tvp != NULL) { if (fvp->v_type == VDIR && tvp->v_type != VDIR) { error = ENOTDIR; goto out; } else if (fvp->v_type != VDIR && tvp->v_type == VDIR) { error = EISDIR; goto out; } } - if (fvp == tdvp) + if (fvp == tdvp) { error = EINVAL; + goto out; + } /* * If the source is the same as the destination (that is, if they * are links to the same vnode), then there is nothing to do. */ if (fvp == tvp) error = -1; #ifdef MAC else error = mac_vnode_check_rename_to(td->td_ucred, tdvp, tond.ni_vp, fromnd.ni_dvp == tdvp, &tond.ni_cnd); #endif out: