Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Sep 2023 00:29:17 GMT
From:      Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 9aa0bb1e9113 - stable/14 - Assert that ifnet_detach_sxlock is held where needed.
Message-ID:  <202309290029.38T0THXD072801@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=9aa0bb1e911373541ecd039fc54270c08e2cffbe

commit 9aa0bb1e911373541ecd039fc54270c08e2cffbe
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2023-09-08 10:06:01 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2023-09-29 00:28:18 +0000

    Assert that ifnet_detach_sxlock is held where needed.
    
    Sponsored by:   NetApp, Inc.
    Sponsored by:   Klara, Inc.
    Reviewed by:    kp
    Differential Revision:  https://reviews.freebsd.org/D41770
    
    (cherry picked from commit 9a071e4e576490370f26307405f12200218dec54)
---
 sys/net/if.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/net/if.c b/sys/net/if.c
index fd4db49a658d..0128fb8039ee 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1128,6 +1128,8 @@ if_detach_internal(struct ifnet *ifp, bool vmove)
 	shutdown = VNET_IS_SHUTTING_DOWN(ifp->if_vnet);
 #endif
 
+	sx_assert(&ifnet_detach_sxlock, SX_XLOCKED);
+
 	/*
 	 * At this point we know the interface still was on the ifnet list
 	 * and we removed it so we are in a stable state.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202309290029.38T0THXD072801>