From owner-svn-src-head@freebsd.org Thu Jun 29 19:43:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03C35DA47D6; Thu, 29 Jun 2017 19:43:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DEC0719DD; Thu, 29 Jun 2017 19:43:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5TJhRDJ073947; Thu, 29 Jun 2017 19:43:27 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5TJhREN073946; Thu, 29 Jun 2017 19:43:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201706291943.v5TJhREN073946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 29 Jun 2017 19:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320480 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 320480 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jun 2017 19:43:29 -0000 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);