1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

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

This commit is contained in:
Jeff Roberson 2005-04-11 09:19:08 +00:00
parent 797bb929c6
commit 836c5b4149
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144898
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);
}