git: 198d2ed2d4c6 - main - devfs: Set eofflag in devfs_readdir()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 May 2025 18:28:13 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=198d2ed2d4c6c921928a9175f825d0d8345e5a46 commit 198d2ed2d4c6c921928a9175f825d0d8345e5a46 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2025-05-29 18:25:56 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2025-05-29 18:25:56 +0000 devfs: Set eofflag in devfs_readdir() At least vn_dir_next_dirent() checks that eofflag is set appropriately when INVARIANTS is enabled, so the omission here could cause an assertion failure. Reviewed by: kib MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50598 --- sys/fs/devfs/devfs_vnops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index e55082b49d97..1d744e6593c0 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -1515,6 +1515,8 @@ devfs_readdir(struct vop_readdir_args *ap) */ if (tmp_ncookies != NULL) ap->a_ncookies = tmp_ncookies; + if (dd == NULL && error == 0 && ap->a_eofflag != NULL) + *ap->a_eofflag = 1; return (error); }