- vput(tvp) before vrele(tdvp) in kern_rename() to avoid lock order issues.

This commit is contained in:
jeff 2005-04-11 09:19:08 +00:00
parent 3fcd99fa67
commit fbc2ade92c
2 changed files with 4 additions and 4 deletions

View File

@ -3261,12 +3261,12 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
} else {
NDFREE(&fromnd, NDF_ONLY_PNBUF);
NDFREE(&tond, NDF_ONLY_PNBUF);
if (tvp)
vput(tvp);
if (tdvp == tvp)
vrele(tdvp);
else
vput(tdvp);
if (tvp)
vput(tvp);
vrele(fromnd.ni_dvp);
vrele(fvp);
}

View File

@ -3261,12 +3261,12 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
} else {
NDFREE(&fromnd, NDF_ONLY_PNBUF);
NDFREE(&tond, NDF_ONLY_PNBUF);
if (tvp)
vput(tvp);
if (tdvp == tvp)
vrele(tdvp);
else
vput(tdvp);
if (tvp)
vput(tvp);
vrele(fromnd.ni_dvp);
vrele(fvp);
}