From: mpi Date: Thu, 25 Jan 2018 14:04:36 +0000 (+0000) Subject: Assert that ifiq_destroy() is not called with the NET_LOCK() held. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=043047e1d73eb585ded6355d328b034a624e1e87;p=openbsd Assert that ifiq_destroy() is not called with the NET_LOCK() held. Calling taskq_barrier() on a softnet thread while holding the lock is clearly a deadlock. ok visa@, dlg@, bluhm@ --- diff --git a/sys/net/ifq.c b/sys/net/ifq.c index 99b4704f8d0..d790f433a6e 100644 --- a/sys/net/ifq.c +++ b/sys/net/ifq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifq.c,v 1.21 2018/01/04 11:02:57 tb Exp $ */ +/* $OpenBSD: ifq.c,v 1.22 2018/01/25 14:04:36 mpi Exp $ */ /* * Copyright (c) 2015 David Gwynne @@ -446,15 +446,8 @@ void ifiq_destroy(struct ifiqueue *ifiq) { if (!task_del(ifiq->ifiq_softnet, &ifiq->ifiq_task)) { - int netlocked = (rw_status(&netlock) == RW_WRITE); - - if (netlocked) /* XXXSMP breaks atomicity */ - NET_UNLOCK(); - + NET_ASSERT_UNLOCKED(); taskq_barrier(ifiq->ifiq_softnet); - - if (netlocked) - NET_LOCK(); } /* don't need to lock because this is the last use of the ifiq */