git: 6df22096ddb2 - stable/15 - mqueuefs: set *a_eofflag in VOP_READDIR
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 10 Nov 2026 04:33:28 UTC
The branch stable/15 has been updated by delphij:
URL: https://cgit.FreeBSD.org/src/commit/?id=6df22096ddb27edb169cfb6758d1dab130f9f683
commit 6df22096ddb27edb169cfb6758d1dab130f9f683
Author: Xin LI <delphij@FreeBSD.org>
AuthorDate: 2026-11-03 03:02:03 +0000
Commit: Xin LI <delphij@FreeBSD.org>
CommitDate: 2026-11-10 04:32:52 +0000
mqueuefs: set *a_eofflag in VOP_READDIR
mqfs_readdir() never reported end of directory. Since 77b273d8f5f4
VOP_READDIR_APV() asserts that a readdir which returns no entries also
sets *a_eofflag, so with INVARIANTS the final zero-length
getdirentries(2) that ls(1) issues on a mounted mqueuefs panics:
panic: VOP_READDIR: eofflag not set
Report end of directory when the child list was walked to its end;
leave the flag clear when the walk stopped because the buffer was full.
(cherry picked from commit fbac0abdc5ab1fe867ac85635662ef06b2ee9d10)
---
sys/kern/uipc_mqueue.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c
index e26a21a6efe0..1c3eb9776eda 100644
--- a/sys/kern/uipc_mqueue.c
+++ b/sys/kern/uipc_mqueue.c
@@ -1459,6 +1459,8 @@ mqfs_readdir(struct vop_readdir_args *ap)
sx_xunlock(&mi->mi_lock);
uio->uio_offset = offset;
+ if (ap->a_eofflag != NULL)
+ *ap->a_eofflag = (pn == NULL);
if (tmp_ncookies != NULL)
ap->a_ncookies = tmp_ncookies;