From 13d3bd165e225eec9af91b6e3361c2482931f95b Mon Sep 17 00:00:00 2001 From: Rick Macklem Date: Thu, 14 May 2026 15:17:55 -0700 Subject: [PATCH] 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 --- sys/kern/subr_uio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c index 6ac932fb669..fa5865fbe93 100644 --- a/sys/kern/subr_uio.c +++ b/sys/kern/subr_uio.c @@ -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);