Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1030167ybe; Wed, 4 Sep 2019 11:24:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUFy1U6BzljD2xF4AhbYJ7/FAMeK0RGcZnkJx4ASwbq65p9x6aMU636LbbofwG8gE0Fma9 X-Received: by 2002:a17:90a:310:: with SMTP id 16mr6575713pje.100.1567621472921; Wed, 04 Sep 2019 11:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567621472; cv=none; d=google.com; s=arc-20160816; b=B3hvGD/GG0fSW57p9Flc9YkRpOMz4tM0fJEnGhmuOGA1VMFx18LDRrQgUqgwGXdyUJ NU0k4NovLteKVeh0n8AWZ8pNKNW7ob3TbPA+ZymvdxBAnNLr0BtIUKEvRU4AG3fZlcW8 hu+ApyYleQrT4z2RD2QY4gWTezTecI8/mmAFBLe9e02d0A1VmPv104Qc+nx3YtBtAMBd Gykjkp2qvm0hGwbjK4U9taOnV1WRcdclnPjMra6U3zyr/rlTeXdrbNuZPv4z26Pf2Ip/ qPRRicnxIf6RFGgY7n2lpwOcplqaMBAnuDbldVmehIgZO4h68tt82c3UyGKeao18BdSf Afhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Dn94qgfIjYIaVpzrcx0tIuouwIQsfykMvjgNvPj1Cj8=; b=mWBj3BB9Cb3EHm+zfnWpu1qFXAi07/C/fvKcKOJcXeJnv2tBNAP1q9zJVzFYKSRrAb 5rBG/QHeBSQGIhnvIeRFTCkhsff7+TNgPem7SYkif3kr4AqyVWclmZ1XHH6Gfz+YE35w PYhWMfsfwuWIbHY9aoFF8RwQAvY9X4yyEbHGPgjOoMCmGtcfgF69dX1GT2r/XvIGK47e MsN5fXyvsu7bxUop6KuBp/qw+0IZ9vOujKgwTodxZxb+byn1gymiJJRm/uu/eJocrIx5 OpGZH7F5m17K/ZolN9Ut/Tnd4n+siOLZS8VRAUY8yvVw0JMXNAI/D5tuvDQSf6AePxzu Vl/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xKymXiX8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12si18472857plh.138.2019.09.04.11.24.17; Wed, 04 Sep 2019 11:24:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xKymXiX8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732951AbfIDSVd (ORCPT + 99 others); Wed, 4 Sep 2019 14:21:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:48362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389422AbfIDSGX (ORCPT ); Wed, 4 Sep 2019 14:06:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F263822CF7; Wed, 4 Sep 2019 18:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620382; bh=2gokYGvDNVOGFCA5l9cgQaxhaq26hTa3a9QSdELUcCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xKymXiX8xuCYUO7UtB9MAOD9a8wFgfVRzMOU12O66m57/Jyf9C7WZtkPaqSBg6ani ksFKXeB8FeYTELGsPLgWUP6w+U0T6o1FFtOLc6ebljqG9w9l6tzH8gV4D538wqouh1 8Bem6FJfSp5v67g72XxF49UsZPR/fsgi0KVmZK2M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Baron , Eric Dumazet , Ursula Braun , Karsten Graul , "David S. Miller" Subject: [PATCH 4.19 36/93] net/smc: make sure EPOLLOUT is raised Date: Wed, 4 Sep 2019 19:53:38 +0200 Message-Id: <20190904175306.383810983@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175302.845828956@linuxfoundation.org> References: <20190904175302.845828956@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jason Baron [ Upstream commit 4651d1802f7063e4d8c0bcad957f46ece0c04024 ] Currently, we are only explicitly setting SOCK_NOSPACE on a write timeout for non-blocking sockets. Epoll() edge-trigger mode relies on SOCK_NOSPACE being set when -EAGAIN is returned to ensure that EPOLLOUT is raised. Expand the setting of SOCK_NOSPACE to non-blocking sockets as well that can use SO_SNDTIMEO to adjust their write timeout. This mirrors the behavior that Eric Dumazet introduced for tcp sockets. Signed-off-by: Jason Baron Cc: Eric Dumazet Cc: Ursula Braun Cc: Karsten Graul Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/smc/smc_tx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/net/smc/smc_tx.c +++ b/net/smc/smc_tx.c @@ -75,13 +75,11 @@ static int smc_tx_wait(struct smc_sock * DEFINE_WAIT_FUNC(wait, woken_wake_function); struct smc_connection *conn = &smc->conn; struct sock *sk = &smc->sk; - bool noblock; long timeo; int rc = 0; /* similar to sk_stream_wait_memory */ timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT); - noblock = timeo ? false : true; add_wait_queue(sk_sleep(sk), &wait); while (1) { sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); @@ -96,8 +94,8 @@ static int smc_tx_wait(struct smc_sock * break; } if (!timeo) { - if (noblock) - set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); + /* ensure EPOLLOUT is subsequently generated */ + set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); rc = -EAGAIN; break; }