subr_uio.c: Remove a KASSERT() for large NFS server I/O

When the NFS server is set to allow an I/O size greater
than 1Mbyte (not allowed in FreeBSD's main yet), a
KASSERT() in allocuio() can fail when:
zfs_freebsd_write()->zfs_write()->zfs_uiocopy()
->cloneuio()->allocuio()
is called for a large NFS server write.

Since the userland API callers to allocuio() already
check that the size does not exceed UIO_MAXIOV,
there does not seem to be a need to a KASSERT()
here.

Removing the KASSERT() allows NFS server writes
of greater than 1Mbyte to work, once the NFS code
is patched to allow them.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D57005
This commit is contained in:
Rick Macklem
2026-05-14 15:17:55 -07:00
parent 4080419d9a
commit 13d3bd165e
-2
View File
@@ -441,8 +441,6 @@ allocuio(u_int iovcnt)
struct uio *uio;
int iovlen;
KASSERT(iovcnt <= UIO_MAXIOV,
("Requested %u iovecs exceed UIO_MAXIOV", iovcnt));
iovlen = iovcnt * sizeof(struct iovec);
uio = malloc(iovlen + sizeof(*uio), M_IOV, M_WAITOK);
uio->uio_iov = (struct iovec *)(uio + 1);