Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1019687ybe; Wed, 4 Sep 2019 11:14:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1VTmbdu0VeU3CgP1DhnxYpqfLKZhzpxZuJo9ycUEjeKcIrjpHHdnmlK6XQjyhFSaR4NA4 X-Received: by 2002:a17:902:bc4c:: with SMTP id t12mr41165674plz.90.1567620860688; Wed, 04 Sep 2019 11:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567620860; cv=none; d=google.com; s=arc-20160816; b=QwTU4M/u9gav5wZjLvzKnJmhTzWB6Q6FBC9sTtfpsNm5YxGWJZIUq/K2TZfs0xkFdI NMqsIX92PczEXF06XgPDTdRe/r4DQDgzp0eWvpsX1b6G7tZkRAiLAr4ZQiXflnokgBbW LzwFT6vGgt7lKdfdrqOXm5arIJN68o1ic6MaEfKJMbRoQGX4iUbN6W4WDGy+LanrzBcU c+Y/5cWaA1iz2ugY/pGWrK96IKP4HnkirzO97w7IuK3V9rjsameKWpBYhWJ/mT/B5CvM YA9/+0Nw3rtZ9koWMCv40Iaduets/Upw29ZuTHXD4jYSponPPOkLcnEgmf4llDVp4WMA 8rCg== 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=YF1PXnJsBpCtErUa1OHDdHbYHJ/I9IITminFVgnbmrs=; b=URjvqOU288WMN4MWzaEnLgm67ycn+aQoDp7vGxiZenxd6oezSk0C1QgNS4R1QvAuqU QCsosSOL9JgoaAwKojArVoITR3u36IiA76Ea4lgZtJIf2LtK+MVK7i2Aihl5L/CKrAg7 9vChbFuOIugRdv42TO6D8Ewd30un4gHUtt00gY4BmjzfFXr3CogGs0PCn+p4QiALwv0g KdT1J2WN6JbgjrAgHBXENEzouVRx7SPwOMSky58WHBsO8rrjWupBPceeTZx1QxFzm7qG HTS9JeG35y6C4G0Ek/xsbtHYqy8NpJEURgbIzH2/bFk1/0aD/dtMK2yfYRhdInt/ug4p EUpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iOIS4SXg; 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 1si20698001pfe.271.2019.09.04.11.14.05; Wed, 04 Sep 2019 11:14:20 -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=iOIS4SXg; 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 S2390277AbfIDSLY (ORCPT + 99 others); Wed, 4 Sep 2019 14:11:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:55368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389877AbfIDSLW (ORCPT ); Wed, 4 Sep 2019 14:11:22 -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 891D12087E; Wed, 4 Sep 2019 18:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620681; bh=nx4BE7QFsN29rEp7SS5/OfNznALXnOvEC33bd5bZ4r0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iOIS4SXgdWhzU5tg47qQkIyAClxmzcTYtj6JtgFQ7gRqDOSFY/+/rnPgcuRt2JsVe PGYnPsjePEocJl1d+RATrTslvkrmCS3h3mQ8ygAmELDfcBt+ECxFtIrFT74lWtKssR 2Ydb5O9IpUVWMk/NJFrb8jZD04d5uKVWN8mLoADo= 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 5.2 053/143] net/smc: make sure EPOLLOUT is raised Date: Wed, 4 Sep 2019 19:53:16 +0200 Message-Id: <20190904175316.142954365@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@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 @@ -76,13 +76,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); @@ -97,8 +95,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; }