Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp470516imm; Thu, 30 Aug 2018 03:36:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZFcenpKvWg3COXtW2giaD8wr8Hk4v1/2K/1FTewj/Nv5YFh4BWrBMWMKdWKfu8Xf34odwc X-Received: by 2002:a17:902:49:: with SMTP id 67-v6mr9871640pla.206.1535625397016; Thu, 30 Aug 2018 03:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535625396; cv=none; d=google.com; s=arc-20160816; b=FKyghVGi0PZeJPuzFmaWGFD7itKL8B2lQTZAp5/tmh3lRgMPRedXMDxbjfsSB6GN1V AhuhX5JBQRCIngS67Kt3Jg7gGZLLYF6KGWxhghkcPzelLytNkc7pttKPAJjSQSL5yJCd 7c+azcRvJgZMH0JJEW5tGCbGbqmaHmARIim94KIm23ji54Sz2+0nX8vf5EECm3kh2Ffy UdASkIWTx/k3NUruFhj4n567tfgb/9GzlITRhynAfTUN34wF25k3MihfkO4S8HKLz+l8 C80IfZqEioWgU/iVPn5t7x9xEtSPBgp9vE+jR7uuBJIgFgfrsmdHhcyF+4spZbDlKKS3 nQAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/tRUuGn0z0CJsTnUjGVfV8fggke3I2Xy9sanxKFiYuI=; b=FDR37EyH2bAfmqRqDYLHDDgW2bnofK4iU5gaJ+fLafS1Fv4uK0wZf3ZSokVaSiksRX SDr5z05rLZRxfMUkibXVMJlu91ZldR07P48gUIMx2czAXorYjOj63qagTNKfEyx2doj4 OYZf3f8wrnS+m+g5eSLTziVs9a2iHQEqiRQV66Q+cxXYbnl0AS8Lowz3rTE4hKFJ5/TX //LNn4qpV0S5gw0/LkGxfXgrDwZ7LbU4gZkUsQG3Vawe5wWImyvLTfRTQR7Dm/HXgPQu 46dN4H6sVi6TjCPj27fqMV6oqKvyHGYteTDjzwhN3Lst3Bcm3c1vqKVdQzb3IGWhfX2x aAVw== ARC-Authentication-Results: i=1; mx.google.com; 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 p2-v6si6489351pfd.76.2018.08.30.03.36.21; Thu, 30 Aug 2018 03:36:36 -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; 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 S1728383AbeH3Ogo (ORCPT + 99 others); Thu, 30 Aug 2018 10:36:44 -0400 Received: from nautica.notk.org ([91.121.71.147]:53017 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728098AbeH3Ogo (ORCPT ); Thu, 30 Aug 2018 10:36:44 -0400 Received: by nautica.notk.org (Postfix, from userid 1001) id 342A9C009; Thu, 30 Aug 2018 12:35:14 +0200 (CEST) From: Dominique Martinet To: Eric Van Hensbergen , Latchesar Ionkov Cc: Dominique Martinet , v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org Subject: [PATCH] 9p/rdma: do not disconnect on down_interruptible EAGAIN Date: Thu, 30 Aug 2018 12:35:07 +0200 Message-Id: <1535625307-18019-1-git-send-email-asmadeus@codewreck.org> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dominique Martinet 9p/rdma would sometimes drop the connection and display errors in recv_done when the user does ^C. The errors were IB_WC_WR_FLUSH_ERR caused by recv buffers that were posted at the time of disconnect, and we just do not want to disconnect when down_interruptible is... interrupted. As a bonus, re-evaluate the log importance of post_recv() failing: we want to see that one if it ever happens. Signed-off-by: Dominique Martinet --- this had actually been bugging me forever, but I couldn't test the refcount stuff properly around flush with that so I had to finally figure it out.. net/9p/trans_rdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index 9cc9b3a19ee7..9719bc4d9424 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c @@ -477,7 +477,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) err = post_recv(client, rpl_context); if (err) { - p9_debug(P9_DEBUG_FCALL, "POST RECV failed\n"); + p9_debug(P9_DEBUG_ERROR, "POST RECV failed: %d\n", err); goto recv_error; } /* remove posted receive buffer from request structure */ @@ -546,7 +546,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) recv_error: kfree(rpl_context); spin_lock_irqsave(&rdma->req_lock, flags); - if (rdma->state < P9_RDMA_CLOSING) { + if (err != -EINTR && rdma->state < P9_RDMA_CLOSING) { rdma->state = P9_RDMA_CLOSING; spin_unlock_irqrestore(&rdma->req_lock, flags); rdma_disconnect(rdma->cm_id); -- 2.17.1