From nobody Mon May 13 18:34:24 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 4VdSnX3T9Wz5KlWw; Mon, 13 May 2024 18:34:24 +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 4VdSnX1r59z4Wt7; Mon, 13 May 2024 18:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715625264; 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=gegQdMFKJWJa4n7tr4WqbGC3GWKBvVApTR0B0L8bbY8=; b=yY1aqIA7nTKIuoO3ZuKP8LL4WUc/fKSsfmW4pRhfnZqXRAmDO6+rz6zXXf5Cc8vy0lhjLL pfo6l5f0IGSWpt77KyvwQzS225BYUP7Xz6MgrGoxY+dciVaQMvtk8ollwXq4DiQ2Blwlnf Ekk/AWR8fm2pub0lk0T6rLPNYeOt9lFH4n68a+F+g/VVP3UrIrYjgCsS8b9CIwtrixwyCp tZ/1ciWuAvXpm0Uy61HJUmd8xym0ih1IDe5irgODLlSo/78+mGCuB+N3a4Hmv4fGEbGDvy bX4PlIv/KT8tvXK6iGjvqDaDTAzgoKxFflO7njJceTb7JtcHyLvE8g5tAbBeFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715625264; a=rsa-sha256; cv=none; b=GxlcCVVLfIMXCzkXBGemMXgAbnbDX2qQ9z3TrZSXU3nPqH4Q5XR6JVXDVGBxETClCGHkQ/ CEDDOOk8J6gTP2w1BQ4MQaJoR7Ye65Ndcwvj1595DVpo6H27KaAQUNazSR08DyW1i7uxHD jBkL74xna/ydazclhcJ5thVJXvu3iNEF6gj1il8+qez/VIoN6NN/OZy68OqNHuh4wwJrnm lCadYOmCEIOfQRC5ugmJjVMtR2cL3RUbRvJfNByNyqjnyJ5HHRYcBvyVBz7k1kRtFK8jJk Obs3Ds2yfbRXKUZZMd1/nBZ0XEW8UvCJAQYl103yMksKoLKDGmFM6MweOtadIg== 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=1715625264; 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=gegQdMFKJWJa4n7tr4WqbGC3GWKBvVApTR0B0L8bbY8=; b=v6BS0mqWp0VYyEAVHFQ+F5C4GBKTyT5hA4JKVsKUcRqd0x4G/fhFixUv33xjW4PDiEgjwR YMnLQ7c0gAu9ckQGHPRMffzJ8kXfduSDqcFFoAewCmJrC+s3SufQEq1eU2lWXNjq4okXIW JQ2heP2L0I4VmShaypRwG31MBt5YA1ZXU1NI44iz9QC4JOcu1iRJesEOyYfgtgKovFFWZR JtMMkskK2hmhkuuiYOAYXDlTyPUlndeyear00/O23LtrQgTOPtghqxTVUqT7uwcGB0z1X6 jjQ/t30ZkwNi+j6D5bcu3uzYXY0B9Saa+a18dOj0LDV7yHbonrh9V2SjaLntOg== 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 4VdSnX1Pb5z10Jn; Mon, 13 May 2024 18:34:24 +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 44DIYOrS049979; Mon, 13 May 2024 18:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DIYOlj049976; Mon, 13 May 2024 18:34:24 GMT (envelope-from git) Date: Mon, 13 May 2024 18:34:24 GMT Message-Id: <202405131834.44DIYOlj049976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 58d7ac11e77d - main - tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58d7ac11e77db28640b8e47f9f9c1fe81d15baf5 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=58d7ac11e77db28640b8e47f9f9c1fe81d15baf5 commit 58d7ac11e77db28640b8e47f9f9c1fe81d15baf5 Author: Konstantin Belousov AuthorDate: 2024-05-06 18:31:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-13 18:33:29 +0000 tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45119 --- sys/fs/tmpfs/tmpfs_subr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 9bdcc4575511..84ce323441c1 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1094,15 +1094,19 @@ loop: KASSERT((object->flags & OBJ_TMPFS_VREF) == 0, ("%s: object %p with OBJ_TMPFS_VREF but without vnode", __func__, object)); - KASSERT(object->un_pager.swp.writemappings == 0, - ("%s: object %p has writemappings", - __func__, object)); VI_LOCK(vp); KASSERT(vp->v_object == NULL, ("Not NULL v_object in tmpfs")); vp->v_object = object; vn_irflag_set_locked(vp, (tm->tm_pgread ? VIRF_PGREAD : 0) | VIRF_TEXT_REF); VI_UNLOCK(vp); + VNASSERT((object->flags & OBJ_TMPFS_VREF) == 0, vp, + ("leaked OBJ_TMPFS_VREF")); + if (object->un_pager.swp.writemappings > 0) { + vrefact(vp); + vlazy(vp); + vm_object_set_flag(object, OBJ_TMPFS_VREF); + } VM_OBJECT_WUNLOCK(object); break; case VDIR: