Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp509758rwe; Wed, 19 Apr 2023 01:55:16 -0700 (PDT) X-Google-Smtp-Source: AKy350ZBpYet7A0KPsmuCb5GrcyFQeUGuywlsEnPpwmDTf4m++6g7Nvf658GGOXEh+3ffsJEI9VW X-Received: by 2002:a05:6a21:1789:b0:ee:c9a4:7e0b with SMTP id nx9-20020a056a21178900b000eec9a47e0bmr2687780pzb.23.1681894516591; Wed, 19 Apr 2023 01:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681894516; cv=none; d=google.com; s=arc-20160816; b=iq7XIQ+hp9EvQcbJVxvuFc2a44toWpv3W3jo0mojVZbOHgYBY8oOSZhACT7EqhTLqy K6sXxTKYwUB6soLaKh3DJcGZF7SnIoPZlvZmIT6qbF3Jl5NVRfOB5nFve7K3RtGSdStj SASQ/mQxhXJX2FBPpdKngLmZFdQhq7vse0Pg5NbXivMWRxnNSGN4fNtMpGRu3qITnZxE af1XGgyvCtI/khPlOT+dHhJQO28g65NKe+kLdDjgkvHReYq6TI5jhIbDxNWgMzMhCVOU cy0BCtqR6sWEd7+8QRROKcXmECJk19Any6yj5ebRXAlPibyegv07g7eCL5qJ7zMzWmA2 2HWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=NEnZ644JL7BzqvU0sxbGAoBWYjk3iv5CXkJiuBwPN/c=; b=PK59X5k4vg7ab6+ClRDViRr4g+ZWrARdsOCH2mdzv4TKUP8idZWc2LiYu4wJdg9IEh mKIj01JddG4+Jz+C4AOepu2WFqXFSyoBntPbO31yah6WZpVRjqzi7WDzxk8LWvMS8d3r +M0iB0mogB8mPu7j9l2cN7RoKi6sBxzIJehrBSiSZUBdE+nWEtAldO/j1imUBKDCzhu4 rHFObepsphMhKNUDV64LsCA+oyWJtQ2uDPNUwtyiW+D7ls53uSXQg1vQguwcoBRWb41P Ndmt5ZB6m8eCB2YOlcbngF92vTAwTnbF+W/rd9XISBePUqZhRp2x8E8EdEr5tvJBQpw/ vzqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=M8tPaWGN; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c24-20020a631c58000000b00502d794102asi1325632pgm.588.2023.04.19.01.55.04; Wed, 19 Apr 2023 01:55:16 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=M8tPaWGN; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232756AbjDSIsK (ORCPT + 99 others); Wed, 19 Apr 2023 04:48:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232730AbjDSIsF (ORCPT ); Wed, 19 Apr 2023 04:48:05 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F29E1A4; Wed, 19 Apr 2023 01:48:04 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 203E321908; Wed, 19 Apr 2023 08:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1681894083; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NEnZ644JL7BzqvU0sxbGAoBWYjk3iv5CXkJiuBwPN/c=; b=M8tPaWGNuTcM0+4I5u+VLunpNCH8/cK5wAYTEPICSez2IJ173pcGHxIEgnWuXF/lZE2ZIS 3TyNEuKQ+TzkG6vjv5A5Gn/d+vsINCs4VC6Y8mnBxfCoUfRq5wOewasrdEfwpvrVCeBe+V FJMcsL7No4pmM/LALJEENsiuc1prKSM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1681894083; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NEnZ644JL7BzqvU0sxbGAoBWYjk3iv5CXkJiuBwPN/c=; b=FHGWW/rllpupFShePGQj1O4dUlE0IMPgumOX32O9iG61oeSYDLecrcR+QYrvAf3mtcmTuO HF8gZr+O13sZBjBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 118961390E; Wed, 19 Apr 2023 08:48:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id yasgBMOqP2S7dQAAMHmgww (envelope-from ); Wed, 19 Apr 2023 08:48:03 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni , Shin'ichiro Kawasaki , Daniel Wagner Subject: [PATCH blktests v2 2/2] nvme-rc: Cleanup fc resource before module unloading Date: Wed, 19 Apr 2023 10:47:57 +0200 Message-Id: <20230419084757.24846-3-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230419084757.24846-1-dwagner@suse.de> References: <20230419084757.24846-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Before we unload the module we should cleanup the fc resources first, basically reorder the shutdown sequence to be in reverse order of the setup path. Also unload the nvme-fcloop after usage. While at it also update the rdma stop_soft_rdma before the module unloading for the same reasoning. Signed-off-by: Daniel Wagner --- tests/nvme/rc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/nvme/rc b/tests/nvme/rc index ec0cc2d8d8cc..41f196b037d6 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -260,18 +260,20 @@ _cleanup_nvmet() { shopt -u nullglob trap SIGINT - modprobe -rq nvme-"${nvme_trtype}" 2>/dev/null - if [[ "${nvme_trtype}" != "loop" ]]; then - modprobe -rq nvmet-"${nvme_trtype}" 2>/dev/null - fi - modprobe -rq nvmet 2>/dev/null if [[ "${nvme_trtype}" == "rdma" ]]; then stop_soft_rdma fi if [[ "${nvme_trtype}" == "fc" ]]; then _cleanup_fcloop "${def_local_wwnn}" "${def_local_wwpn}" \ "${def_remote_wwnn}" "${def_remote_wwpn}" + modprobe -rq nvme-fcloop fi + + modprobe -rq nvme-"${nvme_trtype}" 2>/dev/null + if [[ "${nvme_trtype}" != "loop" ]]; then + modprobe -rq nvmet-"${nvme_trtype}" 2>/dev/null + fi + modprobe -rq nvmet 2>/dev/null } _setup_nvmet() { -- 2.40.0