From patchwork Thu Jul 9 20:45:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 6759481 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 93F449F319 for ; Thu, 9 Jul 2015 20:47:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA3FE20790 for ; Thu, 9 Jul 2015 20:47:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D864F20553 for ; Thu, 9 Jul 2015 20:47:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754635AbbGIUpQ (ORCPT ); Thu, 9 Jul 2015 16:45:16 -0400 Received: from mail-qk0-f169.google.com ([209.85.220.169]:33204 "EHLO mail-qk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754627AbbGIUpM (ORCPT ); Thu, 9 Jul 2015 16:45:12 -0400 Received: by qkhu186 with SMTP id u186so194358328qkh.0; Thu, 09 Jul 2015 13:45:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:subject:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=3m6QyKO4hREhhZ/K9/m4qGsoYGiCY5j+5l3OhthYX8A=; b=GfgeJ4DM0XotzlT1BExEqi82rx05u4xFtPOsFX43bo2Vkv8CG5SKBkCssT5PLA5tAQ dI/dJZd1qHiSQKUSBS8sAfpShMrRz5JuYUP/GASExsic/fb86T2ogWAyb1+8bQYa2fEf +/xWPLmcr4pfdIQAu/TWU5pMbUON2/1DDTq00uT5AgywRbt3PFRmtrFshPuCW9phzQF/ njn5AYf64JBKAScGwClUt49F0lGkjZwl8gTGF+mYFSRI46P57JtC5k3r76hVTZSR245q ZjpwZDCh0oM2GcDwPWAU75dWz9Jl74DHCSVEqVwP0FuYkaZp4AlM2iH8upL7+HY9wA4p s0IQ== X-Received: by 10.55.49.85 with SMTP id x82mr27709479qkx.49.1436474711067; Thu, 09 Jul 2015 13:45:11 -0700 (PDT) Received: from klimt.1015granger.net ([2604:8800:100:81fc:be5f:f4ff:fed6:c3ba]) by smtp.gmail.com with ESMTPSA id 128sm4224166qht.11.2015.07.09.13.45.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 13:45:10 -0700 (PDT) From: Chuck Lever Subject: [PATCH v1 1/5] NFS/RDMA Release resources in svcrdma when device is removed To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Thu, 09 Jul 2015 16:45:08 -0400 Message-ID: <20150709204508.8481.29228.stgit@klimt.1015granger.net> In-Reply-To: <20150709204230.8481.45457.stgit@klimt.1015granger.net> References: <20150709204230.8481.45457.stgit@klimt.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Shirley Ma When removing underlying RDMA device, the rmmod will hang forever if there are any outstanding NFS/RDMA client mounts. The outstanding NFS/RDMA counts could also prevent the server from shutting down. Further debugging shows that the existing connections are not teared down and resource are not released when receiving RDMA_CM_EVENT_DEVICE_REMOVAL event. It seems the original code missing svc_xprt_put() in RDMA_CM_EVENT_REMOVAL event handler thus svc_xprt_free is never invoked to release the existing connection resources. The patch has been passed removing, adding device back and forth without stopping NFS/RDMA service. This will also allow a device to be unplugged and swapped out without shutting down NFS service. BugLink: https://bugzilla.linux-nfs.org/show_bug.cgi?id=252 Signed-off-by: Shirley Ma Reviewed-by: Chuck Lever --- net/sunrpc/xprtrdma/svc_rdma_transport.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 6b36279..f4b9732 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -659,6 +659,7 @@ static int rdma_cma_handler(struct rdma_cm_id *cma_id, if (xprt) { set_bit(XPT_CLOSE, &xprt->xpt_flags); svc_xprt_enqueue(xprt); + svc_xprt_put(xprt); } break; default: