From patchwork Thu Aug 30 10:35:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominique Martinet X-Patchwork-Id: 10581461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4AE82139B for ; Thu, 30 Aug 2018 10:43:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F66128676 for ; Thu, 30 Aug 2018 10:43:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2291728749; Thu, 30 Aug 2018 10:43:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9081928676 for ; Thu, 30 Aug 2018 10:43:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728438AbeH3Oor (ORCPT ); Thu, 30 Aug 2018 10:44:47 -0400 Received: from nautica.notk.org ([91.121.71.147]:58649 "EHLO nautica.notk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728318AbeH3Oor (ORCPT ); Thu, 30 Aug 2018 10:44:47 -0400 X-Greylist: delayed 483 seconds by postgrey-1.27 at vger.kernel.org; Thu, 30 Aug 2018 10:44:46 EDT 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-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);