svn commit: r320480 - head/sys/kern

Navdeep Parhar np at FreeBSD.org
Thu Jun 29 19:43:29 UTC 2017


Author: np
Date: Thu Jun 29 19:43:27 2017
New Revision: 320480
URL: https://svnweb.freebsd.org/changeset/base/320480

Log:
  Adjust sowakeup post-r319685 so that it continues to make upcalls but
  still avoids calling soconnected during sodisconnected.
  
  Discussed with:	glebius@
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/kern/uipc_sockbuf.c

Modified: head/sys/kern/uipc_sockbuf.c
==============================================================================
--- head/sys/kern/uipc_sockbuf.c	Thu Jun 29 19:06:43 2017	(r320479)
+++ head/sys/kern/uipc_sockbuf.c	Thu Jun 29 19:43:27 2017	(r320480)
@@ -322,7 +322,7 @@ sowakeup(struct socket *so, struct sockbuf *sb)
 		wakeup(&sb->sb_acc);
 	}
 	KNOTE_LOCKED(&sb->sb_sel->si_note, 0);
-	if (sb->sb_upcall != NULL && !(so->so_state & SS_ISDISCONNECTED)) {
+	if (sb->sb_upcall != NULL) {
 		ret = sb->sb_upcall(so, sb->sb_upcallarg, M_NOWAIT);
 		if (ret == SU_ISCONNECTED) {
 			KASSERT(sb == &so->so_rcv,
@@ -334,7 +334,7 @@ sowakeup(struct socket *so, struct sockbuf *sb)
 	if (sb->sb_flags & SB_AIO)
 		sowakeup_aio(so, sb);
 	SOCKBUF_UNLOCK(sb);
-	if (ret == SU_ISCONNECTED)
+	if (ret == SU_ISCONNECTED && !(so->so_state & SS_ISDISCONNECTED))
 		soisconnected(so);
 	if ((so->so_state & SS_ASYNC) && so->so_sigio != NULL)
 		pgsigio(&so->so_sigio, SIGIO, 0);


More information about the svn-src-head mailing list