git: 56e00aca338c - stable/14 - zfs readdir: if there were no dirents to copy out, return EINVAL same as UFS
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 25 Aug 2025 08:57:20 UTC
The branch stable/14 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=56e00aca338cc45c3fbd4f95c2a8bb8dfac1efb7
commit 56e00aca338cc45c3fbd4f95c2a8bb8dfac1efb7
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-08-16 01:33:09 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-08-25 08:42:18 +0000
zfs readdir: if there were no dirents to copy out, return EINVAL same as UFS
(cherry picked from commit 9a3edc8d5dbcb896179cfa7867f961184e146a09)
---
sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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 c477ad55dbaa..f87182d1c484 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,6 +1561,7 @@ 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;
@@ -1609,6 +1610,7 @@ 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;
/*
@@ -1786,7 +1788,7 @@ update:
kmem_free(outbuf, bufsize);
if (error == ENOENT)
- error = 0;
+ error = orig_resid == zfs_uio_resid(uio) ? EINVAL : 0;
ZFS_ACCESSTIME_STAMP(zfsvfs, zp);