Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8605851ybl; Thu, 16 Jan 2020 20:45:41 -0800 (PST) X-Google-Smtp-Source: APXvYqytFdxEoUQIS4R+ByvndNPV7VQFM0z57nSU/aquxLuMqYjEcAqOTKOcx7sdi66mr3ZPz4gA X-Received: by 2002:a9d:2dca:: with SMTP id g68mr4507522otb.150.1579236341341; Thu, 16 Jan 2020 20:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579236341; cv=none; d=google.com; s=arc-20160816; b=fYDdIgBa0BwejEtg8GpQeNtwTsFb8aP8I5Ru2QzzYQ785Ise6VWfp0vb77kx5VI5tK Dh4SwHlPkCtK040ts4jqmt/Jdy4Lq4MGCaiH88AGOFgk/hrWeEGfhVDza1e2zKL06Jqf n5xVME3e6dbKpWN3XYxQ96Nf19DXvSE2wbD6U0hHeRsKBKoOK5txpkWDrjiyw0bvf7Vq WahZA/yygHBQg3cFU6sxPUfK7O3Pgltsaot/1lbNNP+2c5hK/klIAYRKv1SxkYj3EdTK LXn3Xn1EH82/OtY06cVSa7UUn43JTbfp+6WJD8cfhJirg7GOxMD/ILHLMo7+J911/ukA us0g== 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=KO3lLLD4QYNxQ+tAL+EXEFCL7BcYv/VVeGaUr13+x0I=; b=EgWWurhTu1OD7H5GdOnjmX09Jy+VXrU3l0O9jYUqTD6C3+6BxmzPaAkoPb4p+GFUvV +k5VQePtd6i4wjXXr7IC1ds5fW2Gst33zl7tO9z84+bU66Rwmrtx4OMtnZm80LSueuFH vr8r8RW+Y8X+CNksw4KIe6inFhamArCA7vAe04ziYbqHJIX3136eUoKnnhTwGw4dqwlN SiuxHBqaFMYDoJAyPI7mQnPkp9C31bBxdv+4SSRWCm78elgeKKZEzLLnfuH72ioPGaer mg3RLa+xYIIfkkjhhmlIpYrScKSnj3zebnI8PJEFGnNQi2pfHdIp+JUpgKAFSyNfpIR8 uY8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I8lra9Is; 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 f187si13667454oia.218.2020.01.16.20.45.29; Thu, 16 Jan 2020 20:45:41 -0800 (PST) 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=I8lra9Is; 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 S2390987AbgAPXpl (ORCPT + 99 others); Thu, 16 Jan 2020 18:45:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:50776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390942AbgAPXWt (ORCPT ); Thu, 16 Jan 2020 18:22:49 -0500 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 7067B2072E; Thu, 16 Jan 2020 23:22:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579216968; bh=i0+bc8psChPsL8aeaO1Qw8WqA3DPbGaJi4hMtSmorAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I8lra9IsS41lva0u+scg77GU8IW5CMgFjblJiy4dsh5SwpjinklnJR8VZY/IxciDp X/Jc2fxjgQarhONil9Qhwkf4zx1SomJievRT3BhA641+4yhxAWt2/87YKunrCq9f5e ydXWPdbQ22/7NDtFPFmBfqa1Qx3hsDZvWyw+7AhQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuck Lever , Anna Schumaker Subject: [PATCH 5.4 094/203] xprtrdma: Fix completion wait during device removal Date: Fri, 17 Jan 2020 00:16:51 +0100 Message-Id: <20200116231753.886716695@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@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: Chuck Lever commit 13cb886c591f341a8759f175292ddf978ef903a1 upstream. I've found that on occasion, "rmmod " will hang while if an NFS is under load. Ensure that ri_remove_done is initialized only just before the transport is woken up to force a close. This avoids the completion possibly getting initialized again while the CM event handler is waiting for a wake-up. Fixes: bebd031866ca ("xprtrdma: Support unplugging an HCA from under an NFS mount") Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker Signed-off-by: Greg Kroah-Hartman --- net/sunrpc/xprtrdma/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -245,6 +245,7 @@ rpcrdma_cm_event_handler(struct rdma_cm_ ia->ri_id->device->name, rpcrdma_addrstr(r_xprt), rpcrdma_portstr(r_xprt)); #endif + init_completion(&ia->ri_remove_done); set_bit(RPCRDMA_IAF_REMOVING, &ia->ri_flags); ep->rep_connected = -ENODEV; xprt_force_disconnect(xprt); @@ -299,7 +300,6 @@ rpcrdma_create_id(struct rpcrdma_xprt *x trace_xprtrdma_conn_start(xprt); init_completion(&ia->ri_done); - init_completion(&ia->ri_remove_done); id = rdma_create_id(xprt->rx_xprt.xprt_net, rpcrdma_cm_event_handler, xprt, RDMA_PS_TCP, IB_QPT_RC);