From nobody Thu Oct 10 13:52:01 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPWQV1025z5Z49L; Thu, 10 Oct 2024 13:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPWQV0YG6z4bnR; Thu, 10 Oct 2024 13:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728568322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B7fgZQpHX3WGKjjdSmYgJSSjGCR8OKrCYt59sYhrQPY=; b=U52yG00VKO7bo28/P4asTeSTgoyCDVEhICc8IPF5bEgb8DtWFPBfD8UZMC9n9DvGJM2HII O0JG3W6ddRcSEpX7EPLLTsCWI7io7ihVQDzdPiI2IleGtYd5vPwNiMazexTfc9llxyxh2D 32SONMCF9BumO0NtYbbQETmpNmAFdkORvyTkcBSixamuJFbiGSaP4zd0DMv652xMq4mGFp ndY1tPxPKZE8be0FNNom6kbwSZ0sK6qipx9o1e1mpzssFTQni3UrAaH+/Eg2ms9T8CxCPj kZjQ5zpMDjRuASwbVHT9u7A4S94ToeoX3jTw9nnukTG+Oes+kQnQy44yaUAIwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728568322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B7fgZQpHX3WGKjjdSmYgJSSjGCR8OKrCYt59sYhrQPY=; b=Y8cVTJRkpI/QQyRVaL0zYlTehAP76cy27/yaTNXGlZp4WbmnHhlKYqItcyaiO0Qy9Kn2RA yCxBY6u9cZucfYkfU62AA0ci2zoqAebD1VvRC0IsW3qjJR5hHrB4pvHRvxt/awxvnx5NoX 2KOXJCg5zwoKSBBshmWZ4hcs4CCv0wwRy30mk5sXvQdquoogpC6qFsXWIX3V6Mcqwv4csp opV++I7qoFGO3YtO/8KMXr9LkcbAbT0TqRLGn6nZGeusYOOCapThSp33FSwhGEOuzbUFeB qo0JsnFju86w2/FHjYBAod6ZwrE/XQOHaFdNCVcW35Z5w/QtZfmYUgpg36S9Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728568322; a=rsa-sha256; cv=none; b=xvqZo2V/luEycExYiDGtGVDBueM0upFQrGDCU43ue/vD425YAJ5oTHnJm2sG+tj6MkMfLm 6k3oHoOi681Xkggi3t6PiHVtJHLpV8INlDvm35c7BIWYdE63iLHWGAoVMKBb6wx/6xMExd m3w+WUGyXuU0tTZsAQH74hzjCSp3ZXQZpVGxEPkrE3qBLuLcPd181mi57OUxvWlpo4GJye cmEE8+QOum1NkjjNcQB704rod/oUqwyMEG6YRcBY/30SUfzxo60xmcRfogyMNV5mxPitW5 2NVG9UaycSn0YBR492uKqvKZslh/rPVb/3O18CjPKaxvBZIS0++sLtBa340wQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPWQV08x2z10qY; Thu, 10 Oct 2024 13:52:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49ADq1br038184; Thu, 10 Oct 2024 13:52:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49ADq1Ul038181; Thu, 10 Oct 2024 13:52:01 GMT (envelope-from git) Date: Thu, 10 Oct 2024 13:52:01 GMT Message-Id: <202410101352.49ADq1Ul038181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 4466a97e83fd - main - sctp: check locking requirements List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4466a97e83fd9484cb22dd2867b6972f6b185e8b Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4466a97e83fd9484cb22dd2867b6972f6b185e8b commit 4466a97e83fd9484cb22dd2867b6972f6b185e8b Author: Michael Tuexen AuthorDate: 2024-10-10 13:50:41 +0000 Commit: Michael Tuexen CommitDate: 2024-10-10 13:50:41 +0000 sctp: check locking requirements Actually assert the locking instead of describing it in a comment. No functional change intended. MFC after: 3 days --- sys/netinet/sctp_pcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index d9dfc4b32821..a1509229f593 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -378,13 +378,13 @@ out: /*- * Add an ifa to an ifn. * Register the interface as necessary. - * NOTE: ADDR write lock MUST be held. */ static void sctp_add_ifa_to_ifn(struct sctp_ifn *sctp_ifnp, struct sctp_ifa *sctp_ifap) { int ifa_af; + SCTP_IPI_ADDR_WLOCK_ASSERT(); LIST_INSERT_HEAD(&sctp_ifnp->ifalist, sctp_ifap, next_ifa); sctp_ifap->ifn_p = sctp_ifnp; atomic_add_int(&sctp_ifap->ifn_p->refcount, 1); @@ -415,11 +415,11 @@ sctp_add_ifa_to_ifn(struct sctp_ifn *sctp_ifnp, struct sctp_ifa *sctp_ifap) * Remove an ifa from its ifn. * If no more addresses exist, remove the ifn too. Otherwise, re-register * the interface based on the remaining address families left. - * NOTE: ADDR write lock MUST be held. */ static void sctp_remove_ifa_from_ifn(struct sctp_ifa *sctp_ifap) { + SCTP_IPI_ADDR_WLOCK_ASSERT(); LIST_REMOVE(sctp_ifap, next_ifa); if (sctp_ifap->ifn_p) { /* update address counts */