Date: Wed, 08 Jul 2026 17:57:31 +0000 From: Alan Somers <asomers@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: CismonX <admin@cismon.net> Subject: git: ed15ec6695f3 - stable/15 - fusefs: only search for FREAD fufh in readdir Message-ID: <6a4e8f8b.390ec.4b2da2af@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=ed15ec6695f3f6330ee1f9a0c64d22e669eb21ed commit ed15ec6695f3f6330ee1f9a0c64d22e669eb21ed Author: CismonX <admin@cismon.net> AuthorDate: 2025-06-20 09:41:46 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2026-07-08 17:56:50 +0000 fusefs: only search for FREAD fufh in readdir The extra search for an FEXEC fufh shall be removed, since readdir is only supposed to be called on a directory opened with FREAD. The sole exception is NFS, which will call VOP_READDIR with directories that aren't open at all. fuse already has special code to handle that. Also remove the fuse_filehandle_get_dir() function, since it's not used anywhere else. Signed-off-by: CismonX <admin@cismon.net> Reviewed by: asomers Pull Request: https://github.com/freebsd/freebsd-src/pull/1729 (cherry picked from commit 4179f1d9deed83977f159c8afea204293ef4c7d7) --- sys/fs/fuse/fuse_vnops.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 1923325bba19..d5404a8b9805 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -265,16 +265,6 @@ fuse_extattr_check_cred(struct vnode *vp, int ns, struct ucred *cred, } } -/* Get a filehandle for a directory */ -static int -fuse_filehandle_get_dir(struct vnode *vp, struct fuse_filehandle **fufhp, - struct ucred *cred, pid_t pid) -{ - if (fuse_filehandle_get(vp, FREAD, fufhp, cred, pid) == 0) - return 0; - return fuse_filehandle_get(vp, FEXEC, fufhp, cred, pid); -} - /* Send FUSE_FLUSH for this vnode */ static int fuse_flush(struct vnode *vp, struct ucred *cred, pid_t pid, int fflag) @@ -1980,7 +1970,7 @@ fuse_vnop_readdir(struct vop_readdir_args *ap) return (EXTERROR(EINVAL, "Buffer is too small")); tresid = uio->uio_resid; - err = fuse_filehandle_get_dir(vp, &fufh, cred, pid); + err = fuse_filehandle_get(vp, FREAD, &fufh, cred, pid); if (err == EBADF && mp->mnt_flag & MNT_EXPORTED) { KASSERT(!fsess_is_impl(mp, FUSE_OPENDIR), ("FUSE file systems that implement "home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a4e8f8b.390ec.4b2da2af>
