From: Matthew Dillon Date: Sat, 18 Jul 2009 15:18:49 +0000 (-0700) Subject: NFS - Fix panic on umount/reboot X-Git-Tag: v2.4.0~412 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/524e83aa4f0548c1eb2660bddd4915f04fdf32b4 NFS - Fix panic on umount/reboot * The rx thread sometimes gets no-error and 0-bytes returned from its soreceive call, but the caller expects a mbuf in that case. Check for the case and convert to EPIPE. --- diff --git a/sys/vfs/nfs/nfs_socket.c b/sys/vfs/nfs/nfs_socket.c index aa477befca..02bfb56c6c 100644 --- a/sys/vfs/nfs/nfs_socket.c +++ b/sys/vfs/nfs/nfs_socket.c @@ -712,13 +712,22 @@ errout: return (EINTR); } } while (error == EWOULDBLOCK); + len = sio.sb_cc; *mp = sio.sb_mb; + + /* + * A shutdown may result in no error and no mbuf. + * Convert to EPIPE. + */ + if (*mp == NULL && error == 0) + error = EPIPE; } if (error) { m_freem(*mp); *mp = NULL; } + /* * Search for any mbufs that are not a multiple of 4 bytes long * or with m_data not longword aligned.