From nobody Mon May 20 00:26:03 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 4VjJJX2FmGz5LKT0; Mon, 20 May 2024 00:26: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 4VjJJW3lVsz4nG3; Mon, 20 May 2024 00:26:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716164763; 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=LHThmjhbrRp1y19V1YkSx9x4FFS/dSjC1Be5lEjr5h8=; b=ju+LkkEaihdeyml0mtn5QT/GrSGpxwq0OZvmthu9V88grC+5v0vgq4p+MbYMve0TgoSrgV cKcP3QA5TN3J4tJb7wwkWyVfR1A4noib07e6alL2DBCWrgnD1t5/zIdVfj37OjQ6UEFEiE xhn5/awp5UuTY1s2IK7tM7uN1iUwKZPUPGYv/zXQs/QXmGXsSbgKwc9D0zaiuDqQmkrrFR v3wPhuhQ50L23TXLi+1KBoqtMU/79qXpMcdNtFGCzPF94TypJcLcAThoEVRhMyXZv31icJ 9Ik2Zcm4d9cjffMdTlG9Fk5WJ/yfKYRRaRMMCoX+2KCeIKJQ65QSDeSTkkNo9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716164763; a=rsa-sha256; cv=none; b=iisDfZUFaBi6WLMtlJ0qwWLmoO1DAIYHJAZmSgrL33PIUeczPeNj0jvpzc2IOLeCQxvJth YiznFNZfMHP/jQj6J36yjTW8nIGJ1JjMCxwvrMrgdkODlc6cLXWlZtdfChGOAZKzBIPisT 0xeVYuqJfLvaLCkcI9xinrVp3unWXaqFH0PeTlEMZwiCdAXQVY/bAGQ6yK+uBJA6WajaXq DXWWHeqislRKwvXo2nXxf01WfXWEvyT4Qr86xQsvQhYw130h1Ul+vKrBSt11bjUH5EXwXZ XGFWn0g7vxKxpYZ9bEPrt2PKd2EsdqKYGNe9G4NwNXDvCOeV3mxaTs7ukx3dxw== 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=1716164763; 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=LHThmjhbrRp1y19V1YkSx9x4FFS/dSjC1Be5lEjr5h8=; b=rDCSBCYJNt/3p3qAL3jkwQGwXZcaeyLKxmY/R7+nfXPyh0T4dM8lSpB/uU5ZiQvTqnT3J7 kfuA7bppo8jyZugEVme03q2cdDNmojrFyVdBN9MfBy9+wJJAPgkpvZtGp3+14+LFDeiieg 4Jb4xksr9N87ASjOFfnv+aV10GODyepexfbq+AP6eAIe+eMNKMtskeG4+fDZmD1KA7Tztj AFBxdyBVrSKWMnMM3HEoMyIhaR39hp+Qp3NFmSXT2aoU0ESLxyD0wkJTgBdlhA7mzQdZ+W ZRiAu+cthVfiUjoJ19RiWEgOruN588rCol+ql5qM7zzG1vZCcf2Q9ophIc0tJQ== 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 4VjJJW2lx0zGrk; Mon, 20 May 2024 00:26:03 +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 44K0Q3Dv008653; Mon, 20 May 2024 00:26:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44K0Q3A2008650; Mon, 20 May 2024 00:26:03 GMT (envelope-from git) Date: Mon, 20 May 2024 00:26:03 GMT Message-Id: <202405200026.44K0Q3A2008650@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: e95708d7a1bf - stable/13 - tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e95708d7a1bf70d555da498eedc1a030a9106096 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e95708d7a1bf70d555da498eedc1a030a9106096 commit e95708d7a1bf70d555da498eedc1a030a9106096 Author: Konstantin Belousov AuthorDate: 2024-05-06 18:31:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-05-19 00:59:13 +0000 tmpfs: recalculate OBJ_TMPFS_VREF on reinstantiating node' vnode (cherry picked from commit 58d7ac11e77db28640b8e47f9f9c1fe81d15baf5) --- 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 d1aff2397cc4..a69e0357bc59 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -1061,14 +1061,18 @@ 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)); 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: