From nobody Fri Jul 05 15:14:25 2024 X-Original-To: dev-commits-src-all@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 4WFxrK5fsvz5PgHM; Fri, 05 Jul 2024 15:14:25 +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 4WFxrK3Vt3z4GQ6; Fri, 5 Jul 2024 15:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720192465; 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=J22gkM/yNg6ZlTkLR/0X317Tno7FwXJlkK0mhFZaS30=; b=AnudGumAjtHsQtaJQYkGBVd7hau2jGnDhN04/9EDA+WK/Etsiw3ZKZGLI4goBjaVgmFrbp VPj8HdJyyRDo6cX9tYvLinv98GA0EjyJDot0IrohmyjK3EtDyWqDTu+N8fgRolriDVXAae E9YkTFQmNT2HHIsNOvkV3BEN/DjbOuhqYug18v7palXpCSkKG7QORgn5rFdETPJ7Ej+94Q u7eirPCJnlCXXtODML+gkztHwwHGEOZk0hB+crjhvsfTcUmxwL0/Q4DnA7WbVT5hFls7Bw gZG/u4aa/cGLzakOvZL1Am+uxN/PoBkmZM2x1AtxN8Z6NN5TUtMrtv/VC/IFCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720192465; a=rsa-sha256; cv=none; b=EXyw+enuc7EYWEsWRiV02wV9GmwKrBBI4dh+QFnBYRuUFV5eVDl8tzzmUXPVIO8a16uBrd FgusJkZUxG69whXbrWt0JdAybwDP1ACQxfeFsYoSIe86PaYLoy3JiwBY4Vuo2WzTBvUEHL UPx4vScH0h2Y7vT+oXGOS/dEl1UL0Uz+3jUuw+lKtya+9m8cqikY+e8ibDQ2ccgwHttrVR gGfJgfKIK69q3crNsPUWlTjDgInDKZsFbe772ojnKgSz85yC8YzcXbXSd1UShPpYPr76+9 W8P+JJIjSB05yaRt0bEyynQz/r2eVxtMfnFOowomT3ZrKfmAgaEviyh5mO6UMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720192465; 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=J22gkM/yNg6ZlTkLR/0X317Tno7FwXJlkK0mhFZaS30=; b=hDrl5iPKWeXYIQ3kReeiR3PVoYUn3VslRAH6UodCmRyP6y2jX4VBK1tu9tyCeZxyifX97q stAeHvQd+R+rnbdtQ7yIwkHxquPCQUnibBdIPD3vVafWry9sNUZAWU4EPiKAkhavirTHhT /OltHb4YgRiEBCIbRYZBPWLwg+jg8v+SrFnYWVw2BAPno+7vNdUODiTrmEMUjYiHz7nov8 54AKw1vNTbELFG4aUZU5PNdpybc4uDZD6VvI4ZZ05nQjO8CfJds6IVf5HaIc+3kP9oZS3c iIHwtZobke+HlAgiV8lum+4NhuoHPWGMZ0fWEzz4rp4Rh8N8P+grCXXcmGL5wg== 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 4WFxrK36zpz11vG; Fri, 5 Jul 2024 15:14:25 +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 465FEP5q098990; Fri, 5 Jul 2024 15:14:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 465FEPE0098987; Fri, 5 Jul 2024 15:14:25 GMT (envelope-from git) Date: Fri, 5 Jul 2024 15:14:25 GMT Message-Id: <202407051514.465FEPE0098987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 3bae3e545e2e - stable/14 - ifnet: Restore curvnet earlier List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3bae3e545e2ef7ee26a94090fdc6962a127310a4 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3bae3e545e2ef7ee26a94090fdc6962a127310a4 commit 3bae3e545e2ef7ee26a94090fdc6962a127310a4 Author: Zhenlei Huang AuthorDate: 2024-06-27 04:38:04 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-05 15:11:51 +0000 ifnet: Restore curvnet earlier This improves readability a little. As a side effect, a redundant CURVNET_RESTORE is removed. No functional change intended. Reviewed by: glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45595 (cherry picked from commit ef4f4a44d9134ddadede0e2e6e658d0688c5ab3c) --- sys/net/if.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 7c282277cb59..b38784622e92 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1345,8 +1345,8 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, char *ifname, int jid) /* XXX Lock interfaces to avoid races. */ CURVNET_SET_QUIET(pr->pr_vnet); difp = ifunit(ifname); + CURVNET_RESTORE(); if (difp != NULL) { - CURVNET_RESTORE(); prison_free(pr); return (EEXIST); } @@ -1356,16 +1356,13 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, char *ifname, int jid) shutdown = VNET_IS_SHUTTING_DOWN(ifp->if_vnet); if (shutdown) { sx_xunlock(&ifnet_detach_sxlock); - CURVNET_RESTORE(); prison_free(pr); return (EBUSY); } - CURVNET_RESTORE(); found = if_unlink_ifnet(ifp, true); if (! found) { sx_xunlock(&ifnet_detach_sxlock); - CURVNET_RESTORE(); prison_free(pr); return (ENODEV); }