aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2025-09-19 17:05:08 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2025-09-19 17:11:50 +0000
commit932e404f12c172e3d4ec47dedee02da400ef8f92 (patch)
treee86e42906b9cf82ba099e3d3a9cb162cd734d676
parente87b75a8bfc8fb7fda8225e55255d9ad99cdefb2 (diff)
Revert "zfs readdir: if there were no dirents to copy out, return EINVAL same as UFS"
This reverts commit 9a3edc8d5dbcb896179cfa7867f961184e146a09. Apparently returning EINVAL is more aggressive than UFS does it, and this causes compatibility issues with apps that actually trigger the behavior. PR: 289485, 289678 Sponsored by: The FreeBSD Foundation MFC after: 3 days
-rw-r--r--sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops_os.c4
1 files changed, 1 insertions, 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 8dce97baba66..411225786089 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
@@ -1698,7 +1698,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;
@@ -1747,7 +1746,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;
zap = zap_attribute_long_alloc();
@@ -1927,7 +1925,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);