Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5789024iob; Tue, 10 May 2022 03:50:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWVu2e3Ot1exF1fE+Hpndem1CcDST2HvQ0EzdwQcwdTtl+R7D2n5P364qtUxVTXW5mFvfg X-Received: by 2002:aa7:c5c8:0:b0:426:34a7:f8b with SMTP id h8-20020aa7c5c8000000b0042634a70f8bmr22153166eds.321.1652179839179; Tue, 10 May 2022 03:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652179839; cv=none; d=google.com; s=arc-20160816; b=IbZW8tA9PlwzloL2C5GTQ2vHXc2LuSOSL1JbfF1IYb+v4ZdzgNKwCZkkpWM1547hEF iO6Ez17mwPwnhTNcL7T7ERdp9dCfND8PnC7p1sFTD2sv3NKSHpJJGgBWPBljahK8R/an dYSHT60vapU9IboBsxDmGeoQv49Hdfqm2pSn3nQpiJqCOgRjoZew9+0UM7IGbdRfo63W KrsLifSEg2i3Ic7dbV5m+ynC3Eprlt5/sOWUOF6NaTdTDyVhaOPZeXXkljMbk8NUi/b4 AKgacHm+fFM5f2VtH+ht5svveNxocg8Isyc8364C8lYkj6zof5pyJ6EGumVqgHdNprw5 JiLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date; bh=XGffN1RL4Jl9IVFIooZoIXC3sa7Ts+5ZyZJtaBuGfho=; b=UGnu0DfnEIw2HJPu9iLE3cAv+KIvQSSubx3kHvLtRMEcN22az1wNKalnJmpkmQe8JU FT/OnME8gsYL3H9qV+gXjlG2pWB0xeN/jAAeaFc7vmgy6m8O4o6154qRmHvLZHsl3c9R ZAMPpxzVLCiuC/TffJBz6FaJLHk9t0GF8Inwtpn/MCAKgh5GWAgbFBiCF7D5gfpvQHA2 wURJmb1QYlAtZz055pqSh4Dl8eYQBaRu6FMByk06kUW4h6EyTOsJ/mtXy92fSKpQy/z8 tvh33XpKxa2dSXlRPBjj0SeLsly5Q6JDlQqc/9ko7Ypl8AdgiXNdjsqdnkWyPPQRZr7y lUig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a056402268100b00425f86e7823si18067940edd.31.2022.05.10.03.50.16; Tue, 10 May 2022 03:50:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235348AbiEJD1e (ORCPT + 99 others); Mon, 9 May 2022 23:27:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbiEJD1c (ORCPT ); Mon, 9 May 2022 23:27:32 -0400 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9343E54F95; Mon, 9 May 2022 20:23:34 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R951e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=tonylu@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0VCofv7V_1652153011; Received: from localhost(mailfrom:tonylu@linux.alibaba.com fp:SMTPD_---0VCofv7V_1652153011) by smtp.aliyun-inc.com(127.0.0.1); Tue, 10 May 2022 11:23:32 +0800 Date: Tue, 10 May 2022 11:23:30 +0800 From: Tony Lu To: Guangguan Wang Cc: kgraul@linux.ibm.com, davem@davemloft.net, kuba@kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net 1/2] net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending Message-ID: Reply-To: Tony Lu References: <20220509115837.94911-1-guangguan.wang@linux.alibaba.com> <20220509115837.94911-2-guangguan.wang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220509115837.94911-2-guangguan.wang@linux.alibaba.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 09, 2022 at 07:58:36PM +0800, Guangguan Wang wrote: > Non blocking sendmsg will return -EAGAIN when any signal pending > and no send space left, while non blocking recvmsg return -EINTR > when signal pending and no data received. This may makes confused. > As TCP returns -EAGAIN in the conditions descriped above. Align the A little typo descriped -> described. > behavior of smc with TCP. I also agree with the behavior of aligning TCP. Fixes tag is preferred: Fixes: 846e344eb722 ("net/smc: add receive timeout check") > Signed-off-by: Guangguan Wang Reviewed-by: Tony Lu Thanks, Tony Lu > --- > net/smc/smc_rx.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c > index 51e8eb2933ff..338b9ef806e8 100644 > --- a/net/smc/smc_rx.c > +++ b/net/smc/smc_rx.c > @@ -355,12 +355,12 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, > } > break; > } > + if (!timeo) > + return -EAGAIN; > if (signal_pending(current)) { > read_done = sock_intr_errno(timeo); > break; > } > - if (!timeo) > - return -EAGAIN; > } > > if (!smc_rx_data_available(conn)) { > -- > 2.24.3 (Apple Git-128)