summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-07-03 01:56:48 +0000
committerkib <kib@FreeBSD.org>2016-07-03 01:56:48 +0000
commitc31bb3499e1215ae394355f759575e2bb6b3b562 (patch)
treec0420b31c156a76e28c7fec0b8295020b1f8c8f7
parent88d44f521d833afc4f1543c6482036092056b794 (diff)
downloadFreeBSD-src-c31bb3499e1215ae394355f759575e2bb6b3b562.zip
FreeBSD-src-c31bb3499e1215ae394355f759575e2bb6b3b562.tar.gz
Remove racy assert. The thread which changes vnode usecount from 0 to 1
does it under the vnode interlock, but the interlock is not owned by the asserting thread. As result, we might read increased use counter but also still see VI_OWEINACT. In collaboration with: nwhitehorn Hardware donated by: IBM LTC Sponsored by: The FreeBSD Foundation (kib) Approved by: re (gjb)
-rw-r--r--sys/kern/vfs_subr.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 5f6dae3..5b4c8a7 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -2536,11 +2536,8 @@ vget(struct vnode *vp, int flags, struct thread *td)
*
* Upgrade our holdcnt to a usecount.
*/
- if (vp->v_type != VCHR &&
- vfs_refcount_acquire_if_not_zero(&vp->v_usecount)) {
- VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp,
- ("vnode with usecount and VI_OWEINACT set"));
- } else {
+ if (vp->v_type == VCHR ||
+ !vfs_refcount_acquire_if_not_zero(&vp->v_usecount)) {
VI_LOCK(vp);
if ((vp->v_iflag & VI_OWEINACT) == 0) {
oweinact = 0;
OpenPOWER on IntegriCloud