From nobody Thu Jun 27 04:39:03 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 4W8m6w4d8Pz5NnPZ; Thu, 27 Jun 2024 04:39:04 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W8m6w1Z3Jz46X3; Thu, 27 Jun 2024 04:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719463144; 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=rROUdgMi0wtih7Wjn6JW9A6hS2SsMo2NwYZr9cL1oE8=; b=YsMqYdZnw3vhMfnETAOtNlbSqk4bHvd7wn2r5wJLCFA5rRrVhdyNJmxhJxG6CN6GeXnB7x nERk/ag8Gj/yUtL4/fQ9um5RX48w1I2AwJufom2t2t+7rBnnHn7gI8fvXe4b2h/1FHkwck kYaG1MKeFZ0hZHXlJsH+YsvOPKZTg9C8TGQE8cefvxbi+JvCNquRfAbaAhFWknHHSJWZrc pRrciho8aAnmErbqMYZs+97lLELMG76mUMHnQyf/VqdDXRdGVDnK8fb8+fYeLCHP9/fbxK bOrCrm0ymyVBpfWFOGXF7jndm2nrF5FLAlIa/GIIEZfU76i8sNeTwsxpMiEltw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719463144; a=rsa-sha256; cv=none; b=aeEYTp+tBadfOUnUZP4h5cmJYHLecMGtQ+yFC/CmOSY3dvYycVhxdJcwsxSR0NL+807jTr BkqHySs/tY/RVCNejdhcQtvNhiLmOLcZa2+N2ayEYI+DbF2bM3JcGumn7PMfEsu2RotgE0 LrndWxuPrt8BmGgJuwlPeWm1rpRiybdNCeyJ8YhGy9QgZ1uF/Acx8y7Bhde+sfOum4ReNv XKUEV8RF9gt0VZ+bAUuAyhdIEcJjhwoGQWCEEdJszZmhFTZwY01faYcSlL0RO0GKq/XyKt r8T2wIiLhelvzR0hiJZ7qhu80Z71yXUMPpm+PamAFhdE32dC35Qotx4JxfGE3Q== 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=1719463144; 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=rROUdgMi0wtih7Wjn6JW9A6hS2SsMo2NwYZr9cL1oE8=; b=P12LOUGlIkLLURXD6cI9TNQ+kyWofMeOcRXk8LkAA5rVmBavJaPsdD4867y1VvoUM5wS77 BZ2IK3sDIyJTVymWyjMxk7yw9DGAUuywfetCRDpATMtNCt6r1zP7Yw9B9ckfADRW8XrEgD STL4UmFGWphEzpZVMzmF6FaMMoKMc1Xj5INCgh+itEeH7M0WkysRkTxqEQzVl/OQt9QS2i otDpN/SNHkXBcd4uO5En6f6gOOGT50MUWIgQ0joz5GypC21djK2hAkt7UBAVuWwbzBZ0Tw xwL9DGtnUKGzt8Dh3TrmBaFsWULVEig4xoHVDjNyUAbmOxl+bh8BtUs5jEKtIg== 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 4W8m6w0vYVz1D5p; Thu, 27 Jun 2024 04:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45R4d3Yf071630; Thu, 27 Jun 2024 04:39:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45R4d3P2071627; Thu, 27 Jun 2024 04:39:03 GMT (envelope-from git) Date: Thu, 27 Jun 2024 04:39:03 GMT Message-Id: <202406270439.45R4d3P2071627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: ef4f4a44d913 - main - ifnet: Restore curvnet earlier 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef4f4a44d9134ddadede0e2e6e658d0688c5ab3c Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ef4f4a44d9134ddadede0e2e6e658d0688c5ab3c commit ef4f4a44d9134ddadede0e2e6e658d0688c5ab3c Author: Zhenlei Huang AuthorDate: 2024-06-27 04:38:04 +0000 Commit: Zhenlei Huang CommitDate: 2024-06-27 04:38:04 +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 --- 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 df405f088133..98be23e564c6 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1343,8 +1343,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); } @@ -1354,16 +1354,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); }