From nobody Fri Jan 20 03:23:32 2023 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 4NylFd008yz30vc9; Fri, 20 Jan 2023 03:23:33 +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 4NylFc5cCrz3nNF; Fri, 20 Jan 2023 03:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185012; 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=PTwnmlXNGA1YnxIC8pKM/sn1h2xWpPdcpc6FUvt5LjM=; b=k4XEsW6ZnXUnng/u58+sO516nZmcvAsoyUfKcL5CflOZWQ+Y0G8CNEwSS338ozLOvQPO45 /loJIKK0UXar7jXteEtZ0p1HVsLyNtmgLQyo/EnXsseKeOmBaQ5kyVibwte160J0m+qDml oKAzPJnRVkeKvjmrPT/9chSQBnwxOuT+8gEqBiB3uC5H6pEFwFJadp98w87pJ0Xn+IDn7A 0TilGdynfZm3JrRlM2v3nDMLRWy2zwd1WDOEtUB9gLAg5Q3jhGBiOGI5hVS1wQupEzxsRx KDEeDP338Ao+Ky4vo/6A/n3vWEfF8sWCq2wpk+AYFpN7nVaU63/hX8skwFl7gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185012; 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=PTwnmlXNGA1YnxIC8pKM/sn1h2xWpPdcpc6FUvt5LjM=; b=wmnW0GlD8pkariqjTnSBpMT+bKL01TJ0KHZ1d6X1yiUO4aL5wDDyTjsBKGWNXeIQ540Z29 nIlMrtiZYS/bxnUXVrDvPWdtRSv8YaiWWYMQr03KwjNcfe8u4q/Vx12+9ft/RjJJwq8PoZ K+/Utps9nxS8MUxFrlzz93nsO1JTQuuyNw/fTnqQuCuqB31SVJ6TLfGrIyUfGhB1F5OwyM B+8bSyihfdXXEe2vcNvK/XculBSfW14SgLRcDdg15Yz5RUgU0vHR5A+oNHnmOX7slN/p/6 /kSGx/Y+8ITvbmBCx8WfvxmtlVGSTxP6Gjt+2DbkF11YW9+HGzssNelz7jH2aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185012; a=rsa-sha256; cv=none; b=aARXRQlmS0dObLqEUur4BzC/S0CBaS5pdpDoS74ZuEkOldhCP5SkVJJSBfy7EwDtj9aChy 7auN5O0J2DRwSb90/d4jvnwfkanaUQXP5iVoUSkdiI9oXADgtlOE+VFnuZOnVQbnMC17nz l/nryHXMGuyaGivOpK20pkew9/u465k9UrnWS70DX9YbQnKkjXiO3SJyN81j2JYe2jhYRa 7HXisTeeYrjxI8rMlywKQwPA1LQr9AHrXNnNdztt6AoSq9ayDUSn8D4pMpfo0ZOr+m0EVd J3UxOiWqsgoBCBt6rdERyCiXydZu5hiwBjy+oaVPjebjWcxVLu7f0brc2B24qg== 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 4NylFc4GBvzGDM; Fri, 20 Jan 2023 03:23:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30K3NWlF042295; Fri, 20 Jan 2023 03:23:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3NWSk042294; Fri, 20 Jan 2023 03:23:32 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:32 GMT Message-Id: <202301200323.30K3NWSk042294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c9e7aae6e6f9 - stable/13 - vm_pager_allocate(): override resulting object type 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c9e7aae6e6f90f700516f0a67fc5cf264daaf610 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c9e7aae6e6f90f700516f0a67fc5cf264daaf610 commit c9e7aae6e6f90f700516f0a67fc5cf264daaf610 Author: Konstantin Belousov AuthorDate: 2022-12-04 00:37:28 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:19:41 +0000 vm_pager_allocate(): override resulting object type Tested by: pho (cherry picked from commit cd086696c2cb6d23bac3bc749836d36a9280ae98) --- sys/vm/vm_pager.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index ea5ce36f1963..cff8f5f9bdc3 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -250,9 +250,14 @@ vm_object_t vm_pager_allocate(objtype_t type, void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t off, struct ucred *cred) { + vm_object_t object; + MPASS(type < nitems(pagertab)); - return ((*pagertab[type]->pgo_alloc)(handle, size, prot, off, cred)); + object = (*pagertab[type]->pgo_alloc)(handle, size, prot, off, cred); + if (object != NULL) + object->type = type; + return (object); } /*