From: Matthew Dillon Date: Fri, 18 Jul 2014 04:33:32 +0000 (-0700) Subject: kernel - turn off auto-socket sizing X-Git-Tag: v4.1.0~403 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/0037b005004b8e673bf0c1c57f72e8227960a085 kernel - turn off auto-socket sizing * Turn off automatic socket sizing for NFS sockets. Otherwise the socket buffer might be reduced to the point where the mbuf interface refuses to queue w/EMSGSIZE. TODO: We need a better fix. --- diff --git a/sys/vfs/nfs/nfs_socket.c b/sys/vfs/nfs/nfs_socket.c index adf290dd87..8c81b5d512 100644 --- a/sys/vfs/nfs/nfs_socket.c +++ b/sys/vfs/nfs/nfs_socket.c @@ -331,6 +331,14 @@ nfs_connect(struct nfsmount *nmp, struct nfsreq *rep) atomic_set_int(&so->so_rcv.ssb_flags, SSB_NOINTR); atomic_set_int(&so->so_snd.ssb_flags, SSB_NOINTR); + /* + * Clear AUTOSIZE, otherwise the socket buffer could be reduced + * to the point where rpc's cannot be queued using the mbuf + * interface. + */ + atomic_clear_int(&so->so_rcv.ssb_flags, SSB_AUTOSIZE); + atomic_clear_int(&so->so_snd.ssb_flags, SSB_AUTOSIZE); + /* Initialize other non-zero congestion variables */ nmp->nm_srtt[0] = nmp->nm_srtt[1] = nmp->nm_srtt[2] = nmp->nm_srtt[3] = (NFS_TIMEO << NFS_RTT_SCALE_BITS); diff --git a/sys/vfs/nfs/nfs_syscalls.c b/sys/vfs/nfs/nfs_syscalls.c index db374bc2cd..2864ce6459 100644 --- a/sys/vfs/nfs/nfs_syscalls.c +++ b/sys/vfs/nfs/nfs_syscalls.c @@ -400,6 +400,14 @@ nfssvc_addsock(struct file *fp, struct sockaddr *mynam, struct thread *td) atomic_clear_int(&so->so_snd.ssb_flags, SSB_NOINTR); so->so_snd.ssb_timeo = 0; + /* + * Clear AUTOSIZE, otherwise the socket buffer could be reduced + * to the point where rpc's cannot be queued using the mbuf + * interface. + */ + atomic_clear_int(&so->so_rcv.ssb_flags, SSB_AUTOSIZE); + atomic_clear_int(&so->so_snd.ssb_flags, SSB_AUTOSIZE); + slp = kmalloc(sizeof (struct nfssvc_sock), M_NFSSVC, M_WAITOK | M_ZERO); mtx_init(&slp->ns_solock); STAILQ_INIT(&slp->ns_rec);