From nobody Fri Jul 05 15:45:23 2024 X-Original-To: dev-commits-src-branches@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 4WFyX33sMWz5PlHH; Fri, 05 Jul 2024 15:45:23 +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 4WFyX335p1z4KmL; Fri, 5 Jul 2024 15:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720194323; 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=mlZ9ZUZH+I2TEGEFZ7a3iFAJFDNYSaHjMbA4JPzSjuo=; b=sl+xQfU88TupRk3io6u0/FWIeM3/h9vUd4tg69ZX8S/ow/ylsAwQ9U8TTwG0emjQH6I0Mj guR6pCtpmB2H8A/Z7ESS8VjN2lD5LsDHWX78AT/0BCBlWYZAIaxjceDrKM/t/zzp7C9ztM yqHNusmAJfMw87PN94zf02mtoBFN8BylVqJl90AkPDOEGmrxbYv1tKPa1PanC/C6EwI7dS QPbS8bXiRj32SmVzHADaR2Lli973hWku8S0txe/nONT9iCQZ8ImsjdoMX0hMwaT5YElURi +E/Ag5RKuZCKYAAuU81cuRNViyqZWmkUteEnm9CVppyPmz1owlPY07jq93noUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720194323; a=rsa-sha256; cv=none; b=FB5mOEr7iZo7YvSqXjKF6PL4xN91JbpvNBRrl1Ht+VA5yavkj2GqwyrJ5tlC7hV3XsYG8U Qf8bM1Jz1YtDDHY4N53W+ZjkhLtZb83uo5TIEzCiUazEo0wdHYHRLZd/J1PWCPfgIS5iYH We/yzV071q/s4AEZV51p7PG79Z9GUs9RYsUbIYXV6G5u3W34wM5Kfe7vRDKCT6v7t+GJbE VuOUWO9roq0S615Zaz2550dOp/x6twm849/r5W+8DRvJ3Vi6CkrJYVLGfAHc/w3LvCUk6Y MU9BWbNm7D/fA5tNaWl7PLcnNbd6Fa9ekptL6DwvtWevTTS/6W1abFAilZpW7Q== 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=1720194323; 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=mlZ9ZUZH+I2TEGEFZ7a3iFAJFDNYSaHjMbA4JPzSjuo=; b=XB2UffCdbDHZRXfc7yLhyvqLh42Mhwa2pGgzWH+QkvTJkxSrzVqq478IGUcW6o+VbH+dlX gvf0D/fYfErQUM2SzLmb2GUYOXB4xg7JkZOpoMfVHFYi1HiED8D0qtN21i+VUmTVotckgM +Xe/7EML21qLjaV31cB4Oi0I+1JrDoc2epahWcF25lf/Hf0SI8jS92poML1+lZytqBoqDk fuNJog2zxSP3z12pv8Ikr0VEuBDfimemorq4XW4MmkpvDYqJU66OkNa99Kgz1rsHhl7bhx t32W1Ek2vULK9UqjjfDtAI4UeDUTxcavjWaCkoDQmC75KztYu35clGMaPxyMIA== 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 4WFyX32gw2z12c7; Fri, 5 Jul 2024 15:45:23 +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 465FjNfh049032; Fri, 5 Jul 2024 15:45:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 465FjNJZ049029; Fri, 5 Jul 2024 15:45:23 GMT (envelope-from git) Date: Fri, 5 Jul 2024 15:45:23 GMT Message-Id: <202407051545.465FjNJZ049029@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: 541f915f421f - stable/13 - ifnet: Restore curvnet earlier List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: 541f915f421f80467f6e356d74b3cc971bcd74f6 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=541f915f421f80467f6e356d74b3cc971bcd74f6 commit 541f915f421f80467f6e356d74b3cc971bcd74f6 Author: Zhenlei Huang AuthorDate: 2024-06-27 04:38:04 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-05 15:43:44 +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) (cherry picked from commit 3bae3e545e2ef7ee26a94090fdc6962a127310a4) --- 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 850d1030a16e..e457ce5c4705 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1414,8 +1414,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); } @@ -1425,16 +1425,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); }