Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jun 2017 19:43:27 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320480 - head/sys/kern
Message-ID:  <201706291943.v5TJhREN073946@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706291943.v5TJhREN073946>