From nobody Wed Nov 13 10:29:02 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 4XpKJZ3hxPz5dS1L; Wed, 13 Nov 2024 10:29:02 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XpKJZ34dwz4SDf; Wed, 13 Nov 2024 10:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731493742; 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=3pGt47nsrC4ZvfuN++5pgS3n1x3pKe4rLCqjx+k1R1s=; b=ZpZn95BZ5j1XN6wTm9bmHe69UUeLqpzt2MmsKcyyQDQabQpBHdGKAOme0DvLE8RMduqF8E 599JPkoKZJPrCBLSTTD9UYnJz9nqXYpez395zlC/GW1TUT0aecZaogDuFQ7BxF4GzCztDI mB9BFpyxpFWDzVpCYg7dbXzPr+JZOJ5h2e6i/U5MVuJyKgLf8b4Iu6AMXejnT5p/x3/pxQ nx5/4k+abrFfaaj3wqP06CxqBfz6QFGHdFHHMYKBAneNF2KaDTyMhBRBKFuZy93pwolrhL PgjoFijnJPPihrmH0jbmb3APJjB6/N+77PD8WqKa9zoooROWeslJ5yM1rGqG0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731493742; 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=3pGt47nsrC4ZvfuN++5pgS3n1x3pKe4rLCqjx+k1R1s=; b=BFQcpUCyrJkJLcMHXvAB+ylSmc5w4cfE84VlK15w1gZexI6Z8D2lHF51c2FJa/4BlFM5yD K0mmpGtZCZb3U5kMk+XK5TwvYSce0K0tMHNew9MMiyNVsI8pDx8prOvQpoFNV6RJcbg4Kb aeIN0f5jGez6iyy2dIF9izUPyLDh9HdTfu7k+KrfyYFy0ywMV9avtLbXrcnNeOtslr+v/N s+T72fBmeXL5XT9nmjWLCRZAl3dSdIXQqumkeKDifKpIiI443d0N8LgrHjcSR4xrcOsZVr cXR6e1RWJkE7KtwZIYyFDoiqentCTZFae8kqB25KemOoRPQJL4DyYJLt0BeJng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731493742; a=rsa-sha256; cv=none; b=ZFklxL33vt1ZuqFrHuXfo/xw/XhiVzXHbgXgShHhxGg+DRZvwx4aEtK5oMf0eVx9RnpNqV 2Tw+hf0KDrXR7NW9I6lAcj3zNKhyhEAV+HZHDuMb0gTLLl8SY8qIaNczysP73C9aR6X5wj KN0Ig+54z3Tit9bmV6Bo1FZ7yG1qkFbcYHEhJOgzJ8MmzuqaKIFLYvAgsDjnxBLWuFDSPy XKCYhqVkFOCSwpMapOpMNK+4T8vXb3zxmiP6s0VqDqOFw6ZC56WtnqTrAjnHZWKZgeP3J+ aqVXfLp5f/jFvabVtfU79NwCD1D+GQAp1l0GHMlV+fsHkeIXE+X2lZyGLDT72A== 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 4XpKJZ2gnGzqd8; Wed, 13 Nov 2024 10:29:02 +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 4ADAT2sL029747; Wed, 13 Nov 2024 10:29:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ADAT2E8029744; Wed, 13 Nov 2024 10:29:02 GMT (envelope-from git) Date: Wed, 13 Nov 2024 10:29:02 GMT Message-Id: <202411131029.4ADAT2E8029744@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: fc595a6b7664 - main - Fix "vrefact: wrong use count 0" with DRM 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: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc595a6b76642dfdfdb8e6f9b9bbc734e95fb59c Auto-Submitted: auto-generated The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=fc595a6b76642dfdfdb8e6f9b9bbc734e95fb59c commit fc595a6b76642dfdfdb8e6f9b9bbc734e95fb59c Author: Edward Tomasz Napierala AuthorDate: 2024-11-13 10:00:38 +0000 Commit: Edward Tomasz Napierala CommitDate: 2024-11-13 10:25:57 +0000 Fix "vrefact: wrong use count 0" with DRM Bump the vnode use count, not its hold count. This fixes a panic triggered by fstatat(..., AT_EMPTY_PATH) on DRM device nodes, which happens to be what glxinfo(1) from Ubuntu Jammy is doing. PR: kern/274538 Reviewed By: kib (earlier version), olce Differential Revision: https://reviews.freebsd.org/D47391 --- sys/compat/linuxkpi/common/src/linux_compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 81d24603d1dd..8f705cd3b2ce 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -772,7 +772,7 @@ linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, } /* hold on to the vnode - used for fstat() */ - vhold(filp->f_vnode); + vref(filp->f_vnode); /* release the file from devfs */ finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); @@ -1504,7 +1504,7 @@ linux_file_close(struct file *file, struct thread *td) error = -OPW(file, td, release(filp->f_vnode, filp)); funsetown(&filp->f_sigio); if (filp->f_vnode != NULL) - vdrop(filp->f_vnode); + vrele(filp->f_vnode); linux_drop_fop(ldev); ldev = filp->f_cdev; if (ldev != NULL)