Fix a case in kern_rename() where a vn_finished_write() call was

missed. This bug has been present since the vn_start_write() and
vn_finished_write() calls were first added in revision 1.159. When
the case is triggered, any attempts to create snapshots on the
filesystem will deadlock and also prevent further write activity
on that filesystem.
This commit is contained in:
iedowse 2002-10-27 23:23:51 +00:00
parent 63fd5e16a0
commit 092b51aeec
2 changed files with 4 additions and 4 deletions

View File

@ -2755,7 +2755,7 @@ rename(td, uap)
int
kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
{
struct mount *mp;
struct mount *mp = NULL;
struct vnode *tvp, *fvp, *tdvp;
struct nameidata fromnd, tond;
int error;
@ -2847,12 +2847,12 @@ out:
vrele(fvp);
}
vrele(tond.ni_startdir);
vn_finished_write(mp);
ASSERT_VOP_UNLOCKED(fromnd.ni_dvp, "rename");
ASSERT_VOP_UNLOCKED(fromnd.ni_vp, "rename");
ASSERT_VOP_UNLOCKED(tond.ni_dvp, "rename");
ASSERT_VOP_UNLOCKED(tond.ni_vp, "rename");
out1:
vn_finished_write(mp);
if (fromnd.ni_startdir)
vrele(fromnd.ni_startdir);
if (error == -1)

View File

@ -2755,7 +2755,7 @@ rename(td, uap)
int
kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
{
struct mount *mp;
struct mount *mp = NULL;
struct vnode *tvp, *fvp, *tdvp;
struct nameidata fromnd, tond;
int error;
@ -2847,12 +2847,12 @@ out:
vrele(fvp);
}
vrele(tond.ni_startdir);
vn_finished_write(mp);
ASSERT_VOP_UNLOCKED(fromnd.ni_dvp, "rename");
ASSERT_VOP_UNLOCKED(fromnd.ni_vp, "rename");
ASSERT_VOP_UNLOCKED(tond.ni_dvp, "rename");
ASSERT_VOP_UNLOCKED(tond.ni_vp, "rename");
out1:
vn_finished_write(mp);
if (fromnd.ni_startdir)
vrele(fromnd.ni_startdir);
if (error == -1)