- Remove vnode lock asserts at the end of vfs syscalls. These asserts were
used to ensure that we weren't exiting the syscall with a lock still held. This wasn't safe, however, because we'd already executed a vput() and on a loaded system the vnode may have been free'd by the time we assert. This functionality is also handled by the td_locks assert in userret, which doesn't tell you what the syscall was, but will at least panic before you deadlock. Sponsored by: Isilon Systems, Inc. Discovred by: Peter Holm Approved by: re (blanket vfs)
This commit is contained in:
parent
59eac186e2
commit
dbb3ec5ce3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=147352
@ -1258,8 +1258,6 @@ kern_mknod(struct thread *td, char *path, enum uio_seg pathseg, int mode,
|
||||
NDFREE(&nd, NDF_ONLY_PNBUF);
|
||||
vput(nd.ni_dvp);
|
||||
vn_finished_write(mp);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "mknod");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "mknod");
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
return (error);
|
||||
}
|
||||
@ -1466,8 +1464,6 @@ kern_link(struct thread *td, char *path, char *link, enum uio_seg segflg)
|
||||
vrele(vp);
|
||||
vn_finished_write(mp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "link");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "link");
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -1557,8 +1553,6 @@ kern_symlink(struct thread *td, char *path, char *link, enum uio_seg segflg)
|
||||
vput(nd.ni_dvp);
|
||||
vn_finished_write(mp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "symlink");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "symlink");
|
||||
out:
|
||||
if (segflg != UIO_SYSSPACE)
|
||||
uma_zfree(namei_zone, syspath);
|
||||
@ -1614,8 +1608,6 @@ undelete(td, uap)
|
||||
vput(nd.ni_dvp);
|
||||
vn_finished_write(mp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "undelete");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "undelete");
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -1701,8 +1693,6 @@ kern_unlink(struct thread *td, char *path, enum uio_seg pathseg)
|
||||
vput(vp);
|
||||
vput(nd.ni_dvp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "unlink");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "unlink");
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -3288,10 +3278,6 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
|
||||
vrele(fvp);
|
||||
}
|
||||
vrele(tond.ni_startdir);
|
||||
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)
|
||||
@ -3387,8 +3373,6 @@ kern_mkdir(struct thread *td, char *path, enum uio_seg segflg, int mode)
|
||||
vput(nd.ni_vp);
|
||||
vn_finished_write(mp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "mkdir");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "mkdir");
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -3475,8 +3459,6 @@ kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg)
|
||||
vput(nd.ni_dvp);
|
||||
vput(vp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "rmdir");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "rmdir");
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
@ -1258,8 +1258,6 @@ kern_mknod(struct thread *td, char *path, enum uio_seg pathseg, int mode,
|
||||
NDFREE(&nd, NDF_ONLY_PNBUF);
|
||||
vput(nd.ni_dvp);
|
||||
vn_finished_write(mp);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "mknod");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "mknod");
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
return (error);
|
||||
}
|
||||
@ -1466,8 +1464,6 @@ kern_link(struct thread *td, char *path, char *link, enum uio_seg segflg)
|
||||
vrele(vp);
|
||||
vn_finished_write(mp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "link");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "link");
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -1557,8 +1553,6 @@ kern_symlink(struct thread *td, char *path, char *link, enum uio_seg segflg)
|
||||
vput(nd.ni_dvp);
|
||||
vn_finished_write(mp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "symlink");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "symlink");
|
||||
out:
|
||||
if (segflg != UIO_SYSSPACE)
|
||||
uma_zfree(namei_zone, syspath);
|
||||
@ -1614,8 +1608,6 @@ undelete(td, uap)
|
||||
vput(nd.ni_dvp);
|
||||
vn_finished_write(mp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "undelete");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "undelete");
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -1701,8 +1693,6 @@ kern_unlink(struct thread *td, char *path, enum uio_seg pathseg)
|
||||
vput(vp);
|
||||
vput(nd.ni_dvp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "unlink");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "unlink");
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -3288,10 +3278,6 @@ kern_rename(struct thread *td, char *from, char *to, enum uio_seg pathseg)
|
||||
vrele(fvp);
|
||||
}
|
||||
vrele(tond.ni_startdir);
|
||||
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)
|
||||
@ -3387,8 +3373,6 @@ kern_mkdir(struct thread *td, char *path, enum uio_seg segflg, int mode)
|
||||
vput(nd.ni_vp);
|
||||
vn_finished_write(mp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "mkdir");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "mkdir");
|
||||
return (error);
|
||||
}
|
||||
|
||||
@ -3475,8 +3459,6 @@ kern_rmdir(struct thread *td, char *path, enum uio_seg pathseg)
|
||||
vput(nd.ni_dvp);
|
||||
vput(vp);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_dvp, "rmdir");
|
||||
ASSERT_VOP_UNLOCKED(nd.ni_vp, "rmdir");
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
@ -159,8 +159,6 @@ vn_open_cred(ndp, flagp, cmode, cred, fdidx)
|
||||
NDFREE(ndp, NDF_ONLY_PNBUF);
|
||||
return (error);
|
||||
}
|
||||
ASSERT_VOP_UNLOCKED(ndp->ni_dvp, "create");
|
||||
ASSERT_VOP_LOCKED(ndp->ni_vp, "create");
|
||||
fmode &= ~O_TRUNC;
|
||||
vp = ndp->ni_vp;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user