Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Sep 1995 17:50:04 -0700
From:      Julian Elischer <julian>
To:        davidg, hackers
Subject:   bug in 4.4lite (fixed in lite2)
Message-ID:  <199509090050.RAA19932@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
while we are updating..
here's one to not miss:

in ufs/ufs/ufs_vnops.c:

        if (fvp == tvp) {
                if (fvp->v_type == VDIR) {
                        error = EINVAL;
                        goto abortit;
                }
                VOP_ABORTOP(fdvp, fcnp);
                vrele(fdvp);
                vrele(fvp);
                vput(tdvp);
                vput(tvp);
                tcnp->cn_flags &= ~MODMASK;
                tcnp->cn_flags |= LOCKPARENT | LOCKLEAF;
                if ((tcnp->cn_flags & SAVESTART) == 0)
                        panic("ufs_rename: lost from startdir");
                tcnp->cn_nameiop = DELETE;
                (void) relookup(tdvp, &tvp, tcnp);
                return (VOP_REMOVE(tdvp, tvp, tcnp));
        }

is back to front.. all the t (to) variables should be f (from) and visa versa.

touch a
ln a b
mv a b

results in a  remaining and b being deleted

in lite2
        if (fvp == tvp) {
                if (fvp->v_type == VDIR) {
                        error = EINVAL;
                        goto abortit;
                }

                /* Release destination completely. */
                VOP_ABORTOP(tdvp, tcnp);
                vput(tdvp);
                vput(tvp);

                /* Delete source. */
                vrele(fdvp);
                vrele(fvp);
                fcnp->cn_flags &= ~MODMASK;
                fcnp->cn_flags |= LOCKPARENT | LOCKLEAF;
                if ((fcnp->cn_flags & SAVESTART) == 0)
                        panic("ufs_rename: lost from startdir");
                fcnp->cn_nameiop = DELETE;
                (void) relookup(fdvp, &fvp, fcnp);
                return (VOP_REMOVE(fdvp, fvp, fcnp));
        }

get's it right..
I just noticed this when adding rename to devfs..
but 4.4l2 noticed before me :)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509090050.RAA19932>