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:
parent
63fd5e16a0
commit
092b51aeec
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user