git: 0d698e74fb6b - stable/14 - devfs: Set eofflag in devfs_readdir()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Jun 2025 13:52:27 UTC
The branch stable/14 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=0d698e74fb6b188037fffb626efc050e41b5afcd
commit 0d698e74fb6b188037fffb626efc050e41b5afcd
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-05-29 18:25:56 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-06-20 12:47:27 +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
(cherry picked from commit 198d2ed2d4c6c921928a9175f825d0d8345e5a46)
---
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 7d17362df05e..4b6845602218 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -1517,6 +1517,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);
}