--- sys/fs/nfsserver/nfs_nfsdserv.c.copylen	2024-02-28 15:35:47.700531000 -0800
+++ sys/fs/nfsserver/nfs_nfsdserv.c	2024-02-28 15:41:33.723022000 -0800
@@ -99,6 +99,9 @@ SYSCTL_BOOL(_vfs_nfsd, OID_AUTO, enable_v42allocate, C
 SYSCTL_BOOL(_vfs_nfsd, OID_AUTO, enable_v42allocate, CTLFLAG_RW,
     &nfsrv_doallocate, 0,
     "Enable NFSv4.2 Allocate operation");
+static uint64_t nfsrv_maxcopyrange = 10 * 1024 * 1024;
+SYSCTL_U64(_vfs_nfsd, OID_AUTO, maxcopyrange, CTLFLAG_RW,
+    &nfsrv_maxcopyrange, 0, "Max size of a Copy so RPC times reasonable");
 
 /*
  * This list defines the GSS mechanisms supported.
@@ -5778,7 +5781,15 @@ nfsrvd_copy_file_range(struct nfsrv_descript *nd, __un
 			nd->nd_repstat = error;
 	}
 
-	xfer = len;
+	/*
+	 * Do the actual copy to an upper limit of vfs.nfsd.maxcopyrange.
+	 * This limit is applied to ensure that the RPC replies in a
+	 * reasonable time.
+	 */
+	if (len > nfsrv_maxcopyrange)
+		xfer = nfsrv_maxcopyrange;
+	else
+		xfer = len;
 	if (nd->nd_repstat == 0) {
 		nd->nd_repstat = vn_copy_file_range(vp, &inoff, tovp, &outoff,
 		    &xfer, COPY_FILE_RANGE_TIMEO1SEC, nd->nd_cred, nd->nd_cred,
