- vput(tvp) before vrele(tdvp) in kern_rename() to avoid lock order issues.
This commit is contained in:
parent
3fcd99fa67
commit
fbc2ade92c
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user