From nobody Fri Nov 06 19:54:46 2026 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 4jLqdf40Gtz6yf0P for ; Fri, 06 Nov 2026 19:54:46 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jLqdf30Znz4F38 for ; Fri, 06 Nov 2026 19:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793994886; 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=51j1gNYpf/QdvSMwVi5/BMHVYXMOpw9SKyHG1W7NE54=; b=KhMk6BliwYpeezuiu+6qp9Dov+jLTBc1upWo0nqdE598McTq1eND02MdfSqsIjL0hY0EDg 3eHISz7iPVUaAQrLKQOvcKU6Vn2VrgbJbg2qsQEV/OR4ok5l2n4UPp5tMhv1Q1oBHnWVdo ucKuAmDCZpsnHZ60HcvbbVIeKUpPaX+lPBjDWFBbEjxF7JNao7SVA1yrtDcoCu2v0lZaFG NcltIoqhq8OrK/IPQ7w7RZe8SULhazKctDWpcU1sYmFMzCz5EB1RP4+r3odq0RkoiVVRXT IbZT5wqxv5GHjl6o971VOAYP/iUd/soLEHvLMKQB83yQMIcHArvQjLG2zjVA7w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793994886; b=bbA8ZrGudB6g/Ad8F2ohZgZ5Gy9Wl0Cwh6LpyYpTWjkMDK/FLZbLCqZ5hWCL6jfPU3BFKk qYMz/skufuCvv8EcHxVG9KVlawlm7NFjvCuAy+NsgqRAnG1xvt1QbktTb3lmsBl30zC86q XQiOPVv7qALZydYblcmdB/e99Hzgw43+QI+DRW1n38C6GHSEnasOexkw2d2fOWYDFxBShF miMy1D42glOzV1zKWm8+K8QZzyX3pbkGDKdchTgOKM4YKBNl/xt6W6UZZSWkzodDscN3fA ypv0zjQUHbGiSGlfUvQBKT9mQoHl+5Mmi4ta7DgM8wSYsHFNp00tOoK7XRb6wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793994886; 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=51j1gNYpf/QdvSMwVi5/BMHVYXMOpw9SKyHG1W7NE54=; b=ChyWI57angfUhJwbMaexDjz9V9SctIfBYEqfb5C9MU3pA5focTZbnQGQ2Dxd9ypqN1SmSN 1sr4PqvQ+4HQ9OOksY0a2Mk03uvktQZ6fU23AiLC60EHsGOisyTWmPva+QVwLYs6EG9LwO RKRZzBKX6iBNfUZJLaqJ2HZAmhxHSqrEX4bn9ND+CndbMrJYXAwsbOa7Ug7jlj+OHY0Iji mUiX/anyUX9MJ8NuunT4L0FeQKYzeunqnYyQMdJUdhfZ+Rp0ZSJzQRj/h4uJJ8H1jo5Gb8 aV6T9jAgGcmcN5nCbrshdgFjgHEy0Y3pRAY+icBIYpiJlovZnEnvpKjpgTymZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jLqdf2BLRzrpw for ; Fri, 06 Nov 2026 19:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1df3b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 06 Nov 2026 19:54:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: d4f4bd11adf2 - stable/15 - inotify: Open target the directory when adding a watch List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: d4f4bd11adf266b926400b4725682d39187a489d Auto-Submitted: auto-generated Date: Fri, 06 Nov 2026 19:54:46 +0000 Message-Id: <6aee3086.1df3b.1e01a782@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d4f4bd11adf266b926400b4725682d39187a489d commit d4f4bd11adf266b926400b4725682d39187a489d Author: Mark Johnston AuthorDate: 2026-10-19 13:44:41 +0000 Commit: Mark Johnston CommitDate: 2026-11-06 15:52:19 +0000 inotify: Open target the directory when adding a watch When an application uses inotify to watch a directory, vn_inotify_add_watch() reads the directory entries and does a name lookup so as to induce the filesystem to create namecache entries. Some filesystems expect the directory to be opened before VOP_READDIR can be called, so do that. PR: 299239 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D60782 (cherry picked from commit de80428118101624aaeaae02d59665d1027ff10e) --- sys/kern/vfs_inotify.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c index bc8db76d848b..fe9dedfaa942 100644 --- a/sys/kern/vfs_inotify.c +++ b/sys/kern/vfs_inotify.c @@ -785,6 +785,14 @@ vn_inotify_add_watch(struct vnode *vp, struct inotify_softc *sc, uint32_t mask, size_t buflen, len; int eof, error; + /* + * Some filesystems, at least fuse, require that the directory + * be opened before reading it. + */ + error = VOP_OPEN(vp, FREAD, td->td_ucred, td, NULL); + if (error != 0) + return (error); + buflen = 128 * sizeof(struct dirent); buf = malloc(buflen, M_TEMP, M_WAITOK); @@ -821,6 +829,7 @@ vn_inotify_add_watch(struct vnode *vp, struct inotify_softc *sc, uint32_t mask, vrele(nd.ni_vp); } free(buf, M_TEMP); + VOP_CLOSE(vp, FREAD, td->td_ucred, td); if (error != 0) return (error); }