git: 5367bef13886 - stable/14 - Revert "zfs readdir: if there were no dirents to copy out, return EINVAL same as UFS"

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Mon, 22 Sep 2025 04:54:34 UTC
The branch stable/14 has been updated by kib:

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

commit 5367bef138862b21f937a66b5647f8f81e6f2ab7
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-09-19 17:05:08 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-09-22 04:54:00 +0000

    Revert "zfs readdir: if there were no dirents to copy out, return EINVAL same as UFS"
    
    PR:     289485, 289678
    
    (cherry picked from commit 932e404f12c172e3d4ec47dedee02da400ef8f92)
---
 sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
index f87182d1c484..c477ad55dbaa 100644
--- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
+++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c
@@ -1561,7 +1561,6 @@ zfs_readdir(vnode_t *vp, zfs_uio_t *uio, cred_t *cr, int *eofp,
 	objset_t	*os;
 	caddr_t		outbuf;
 	size_t		bufsize;
-	ssize_t		orig_resid;
 	zap_cursor_t	zc;
 	zap_attribute_t	zap;
 	uint_t		bytes_wanted;
@@ -1610,7 +1609,6 @@ zfs_readdir(vnode_t *vp, zfs_uio_t *uio, cred_t *cr, int *eofp,
 	error = 0;
 	os = zfsvfs->z_os;
 	offset = zfs_uio_offset(uio);
-	orig_resid = zfs_uio_resid(uio);
 	prefetch = zp->z_zn_prefetch;
 
 	/*
@@ -1788,7 +1786,7 @@ update:
 		kmem_free(outbuf, bufsize);
 
 	if (error == ENOENT)
-		error = orig_resid == zfs_uio_resid(uio) ? EINVAL : 0;
+		error = 0;
 
 	ZFS_ACCESSTIME_STAMP(zfsvfs, zp);