git: d4cdba5b2f55 - main - p9fs: Set *eofflag in p9fs_readdir()

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 15 Jul 2025 12:53:07 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=d4cdba5b2f55b62ba1558995226dd9d93fe00af8

commit d4cdba5b2f55b62ba1558995226dd9d93fe00af8
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-07-15 00:20:06 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-07-15 12:52:56 +0000

    p9fs: Set *eofflag in p9fs_readdir()
    
    Reviewed by:    kib
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D50760
---
 sys/fs/p9fs/p9fs_vnops.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sys/fs/p9fs/p9fs_vnops.c b/sys/fs/p9fs/p9fs_vnops.c
index 56bf766ef801..227e2b93883e 100644
--- a/sys/fs/p9fs/p9fs_vnops.c
+++ b/sys/fs/p9fs/p9fs_vnops.c
@@ -1784,6 +1784,9 @@ p9fs_readdir(struct vop_readdir_args *ap)
 		return (EBADF);
 	}
 
+	if (ap->a_eofflag != NULL)
+		*ap->a_eofflag = 0;
+
 	io_buffer = uma_zalloc(p9fs_io_buffer_zone, M_WAITOK);
 
 	/* We haven't reached the end yet. read more. */
@@ -1801,8 +1804,11 @@ p9fs_readdir(struct vop_readdir_args *ap)
 		count = p9_client_readdir(vofid, (char *)io_buffer,
 		    diroffset, count);
 
-		if (count == 0)
+		if (count == 0) {
+			if (ap->a_eofflag != NULL)
+				*ap->a_eofflag = 1;
 			break;
+		}
 
 		if (count < 0) {
 			error = EIO;