anyone believe this KASSERT?

Sam Leffler sam at errno.com
Thu Oct 23 14:40:10 PDT 2003


uipc_socket.c has a KASSERT in soreceive that I think is wrong.  It dates from 
a long time ago but I can't tell exactly who created it since some 
intermediate munging buggered the CVS logs.

cvs diff: Diffing .
Index: uipc_socket.c
===================================================================
RCS file: /usr/ncvs/src/sys/kern/uipc_socket.c,v
retrieving revision 1.155
diff -u -r1.155 uipc_socket.c
--- uipc_socket.c       21 Oct 2003 18:28:35 -0000      1.155
+++ uipc_socket.c       23 Oct 2003 20:33:04 -0000
@@ -855,9 +855,11 @@
            (so->so_rcv.sb_cc < so->so_rcv.sb_lowat ||
            ((flags & MSG_WAITALL) && uio->uio_resid <= so->so_rcv.sb_hiwat)) 
&&
            m->m_nextpkt == 0 && (pr->pr_flags & PR_ATOMIC) == 0)) {
+#if 0
                KASSERT(m != 0 || !so->so_rcv.sb_cc,
                    ("receive: m == %p so->so_rcv.sb_cc == %u",
                    m, so->so_rcv.sb_cc));
+#endif
                if (so->so_error) {
                        if (m)
                                goto dontblock;

In particular the m != 0 clause is suspicous since the enclosing if permits m 
to be 0 and the code inside carefully handles the case.

I've been running w/o this assert for several weeks w/o a problem.  Previously 
I was seeing it trip for NFS related traffic.

Anyone care to justify keeping this?

	Sam



More information about the freebsd-net mailing list