Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3077265rwb; Mon, 15 Aug 2022 17:33:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4nBKpu2dubVmJsw2UNNUTnRBWrDTI7KZXQcnpCqAf8BU4wZjmzJplsK09T6VkgX5AONzP2 X-Received: by 2002:a17:907:94d6:b0:730:bfe6:8352 with SMTP id dn22-20020a17090794d600b00730bfe68352mr11763804ejc.348.1660610026290; Mon, 15 Aug 2022 17:33:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610026; cv=none; d=google.com; s=arc-20160816; b=GcrtnTyJECPZuaywINoq9kzPCAj2bJQUSkdMX4R69+uhsgZrVLAP6wdewfuIL9wWaE SQxSERv5R6rguK+SMVg+j83W/x83rPMhNVnkt44+GEveNiysvQOTl39RWDBxC38B8rjS bXWvhd9fUPGWiBGNBxWEx9zRvPUvjTBtq5un+gDabIRqS49i9ThX0srgmwc+cj6D7geB vwyZ7PhIJk2iK80Df2TvWCVtfshiDZNto3GRGbH9HDfhc2oCOiLW1egGzB2pYuEcOMQe X92TfKviy7sKQq83zPricTXQsWjN5aDC6WtBXfv548PRw57OlOvucXLWZ/X2qAP+kTdX 8t+Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vLOW0qJLhuY4+eswYrpdgd22zfSUYQ+PzRDeI0G2isE=; b=FqA8c4rMMf2K7gj16LENfHx4Zm1REfTdyk4YWgbye5j9U3TKoVg33IiArfnhgNMHWb nC4Amn+aSZGNOZ+oFyJfye5RGOBzEmDhcy2Y9MixJy8fEVXFmCJrbgGF4tZb26naLerA ofKHLq6xMCk9ByqnY+Wq0qdWNhDOheZpKoE7lGfggz2H5UhaZWT3etglQfHMjtZXBqjb j6bEtZhTQp+8JIZdcW0ZLtaXMNJlJwOiFmSiiDxSmUh0VVGXwdNah+oizibIYpT2kqqn 1lSr/gwy8nAbXx2Kiozgp6NMef7F3SNIdYQzm1XR//lmxIgsjed2t4/yTAQ0feT01ZLM UQ2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="FgIdh5k/"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o18-20020a056402439200b0043c44a822e0si10296722edc.53.2022.08.15.17.33.18; Mon, 15 Aug 2022 17:33:46 -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=@linuxfoundation.org header.s=korg header.b="FgIdh5k/"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345471AbiHPARn (ORCPT + 99 others); Mon, 15 Aug 2022 20:17:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356789AbiHPAH7 (ORCPT ); Mon, 15 Aug 2022 20:07:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EABA172C00; Mon, 15 Aug 2022 13:29:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D9A2560EE9; Mon, 15 Aug 2022 20:29:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF7BDC433D6; Mon, 15 Aug 2022 20:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595340; bh=uqZcaJCwpR4tvAkaLzZ8vTWBYN/99OrptHDtyN8vDYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FgIdh5k/AinWIHwTsV039OCeK05zPpwJrgNcmsXyYP7IsvZN1b4W5XpnONGljIdO6 aOZooKL6dvGL+xYrEXYnM4cShbbnLq/Eiyv4ku4WbZhQdc2jiG7uHTLBCIp6byL109 MlqalBnpiKCirBrcUKXtb2bMyoJff/oVbnyypsHs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nilesh Javali , Mike Christie , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.19 0734/1157] scsi: iscsi: Allow iscsi_if_stop_conn() to be called from kernel Date: Mon, 15 Aug 2022 20:01:30 +0200 Message-Id: <20220815180508.827480883@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Mike Christie [ Upstream commit 3328333b47f4163504267440ec0a36087a407a5f ] iscsi_if_stop_conn() is only called from the userspace interface but in a subsequent commit we will want to call it from the kernel interface to allow drivers like qedi to remove sessions from inside the kernel during shutdown. This removes the iscsi_uevent code from iscsi_if_stop_conn() so we can call it in a new helper. Link: https://lore.kernel.org/r/20220616222738.5722-3-michael.christie@oracle.com Tested-by: Nilesh Javali Reviewed-by: Nilesh Javali Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/scsi_transport_iscsi.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 5d21f07456c6..a410d0b8a445 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -2264,16 +2264,8 @@ static void iscsi_if_disconnect_bound_ep(struct iscsi_cls_conn *conn, } } -static int iscsi_if_stop_conn(struct iscsi_transport *transport, - struct iscsi_uevent *ev) +static int iscsi_if_stop_conn(struct iscsi_cls_conn *conn, int flag) { - int flag = ev->u.stop_conn.flag; - struct iscsi_cls_conn *conn; - - conn = iscsi_conn_lookup(ev->u.stop_conn.sid, ev->u.stop_conn.cid); - if (!conn) - return -EINVAL; - ISCSI_DBG_TRANS_CONN(conn, "iscsi if conn stop.\n"); /* * If this is a termination we have to call stop_conn with that flag @@ -3720,7 +3712,12 @@ static int iscsi_if_transport_conn(struct iscsi_transport *transport, case ISCSI_UEVENT_DESTROY_CONN: return iscsi_if_destroy_conn(transport, ev); case ISCSI_UEVENT_STOP_CONN: - return iscsi_if_stop_conn(transport, ev); + conn = iscsi_conn_lookup(ev->u.stop_conn.sid, + ev->u.stop_conn.cid); + if (!conn) + return -EINVAL; + + return iscsi_if_stop_conn(conn, ev->u.stop_conn.flag); } /* -- 2.35.1