In case of mac_check_vnode_rename_from() or vn_start_write() failure,

vn_finished_write() should not be called.

Reviewed by:	ssouhlal
MFC after:	3 days
This commit is contained in:
pjd 2005-09-01 21:46:33 +00:00
parent 496d9adeda
commit 226a90d03e
2 changed files with 4 additions and 2 deletions

View File

@ -3215,6 +3215,7 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
NDFREE(&fromnd, NDF_ONLY_PNBUF);
vrele(fromnd.ni_dvp);
vrele(fvp);
vn_finished_write(mp);
goto out1;
}
tvfslocked = NDHASGIANT(&tond);
@ -3268,8 +3269,8 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
vrele(fvp);
}
vrele(tond.ni_startdir);
out1:
vn_finished_write(mp);
out1:
if (fromnd.ni_startdir)
vrele(fromnd.ni_startdir);
VFS_UNLOCK_GIANT(fvfslocked);

View File

@ -3215,6 +3215,7 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
NDFREE(&fromnd, NDF_ONLY_PNBUF);
vrele(fromnd.ni_dvp);
vrele(fvp);
vn_finished_write(mp);
goto out1;
}
tvfslocked = NDHASGIANT(&tond);
@ -3268,8 +3269,8 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
vrele(fvp);
}
vrele(tond.ni_startdir);
out1:
vn_finished_write(mp);
out1:
if (fromnd.ni_startdir)
vrele(fromnd.ni_startdir);
VFS_UNLOCK_GIANT(fvfslocked);