From patchwork Fri Apr 8 00:13:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 559132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B520AC433EF for ; Fri, 8 Apr 2022 00:13:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232704AbiDHAPo (ORCPT ); Thu, 7 Apr 2022 20:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232684AbiDHAPj (ORCPT ); Thu, 7 Apr 2022 20:15:39 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72B8D108575 for ; Thu, 7 Apr 2022 17:13:33 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237Jv8ix005378; Fri, 8 Apr 2022 00:13:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=eh2FIw1qtJmmI1n37a4yxA3fO27VVWVvalpYDin9MeA=; b=UrvhzqXs5s5cGmzMP+u0x5LQSAmFgW1lA6RfhfvO+G1bnLtYKpA1L4RPICzpPD0crpQl SXc6sTrV6WxrVnnyA4d0E7bIZ4HsRJrGwjIGw39va5AnfYph+A21LFthhuLYOVW19NRq I/Ft8AKOrF8Kmbi4AJ0Yjaqjx1DqJdHSWzAQSQ0dT6NWajNrNsE/ZcUUlP/fQyB3bIj6 Gckip47umiC+Ccs1d3YWXXWK+7DPYjZWKSIm854wZhCM62NzRLdrPoEAgjOX4eOniAoL htGmXK1Kaoy5JRqOnh2BB4xFBGs9Sil/+PNITOhoGj7Njs0VrbmMQDpYNqgLAw74PUZ4 EQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6d935ens-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:26 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 237NFHE0013838; Fri, 8 Apr 2022 00:13:25 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3f97tu11q5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QVDvvW885pN/CgGO+usJPMfTU1OHcJ7PCyyJkdscOp3MRz999AyfAFbZPqNJWyQez3tdSVETt4ZJkk2I680+oNWUOIqzPGj/mhYfOEtJO8IbM6XuK3gNmh6VQYfOukURq2aJ+zEkZ+Dowq6cdc5g9dIpWgegSSX6g5nfgJ2evhp1rdQeojJsI1nC/A9gnIT8utZ2KleKzbKcN8Vlrt6NPI8HAIwmH90rjdj4EhMwx8nPEX4BPY57WIDXsnp+POffralv6ZW/3CZDSrg5Jrp5l42Kp46GpzsdK1doDaGUYAmhj7M5DW7YgZJmzQyPLEdBSW2r/sn1SJavlS8ATh22wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eh2FIw1qtJmmI1n37a4yxA3fO27VVWVvalpYDin9MeA=; b=DwZMc1LZOIhJ8jv/WmMC93pKkQyhP+k7KgZT3QjY9bm4CZs68Fn7paNN2QUIwRESmDtAd24UAY8uYNjmdi98ppKlF9wAmDAI+pIGoXG4TZdjEUefdt1gHnsefRkttsWLgJhlejKBp9+3C1zObNn9F+8s8TjE3q1ATRRNMF+Ms9Elabh4DV43jsQfWfk5viTddqRenttgmsfWFSArh8W8GRtJSp3TN5aqzUfPQRmX7A+rmOu6eQDprWD3RZVrMYABPBRuDOdbeVyIKJ72uxoGnOgJaE5gebVTjYtTwyGEKH1J6IZ48oWCje+IMa6a4dxxBMnaHjORA5q3bHJHFci2OA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eh2FIw1qtJmmI1n37a4yxA3fO27VVWVvalpYDin9MeA=; b=aUKOHxpSO3LZ8lBzsnwFE0WRmTPCVpTAk8wKOBIu1b68VhJfc9YkaC83zv+BRNGASSuAk1Bce6/y23OJ2DzxdVvT0iAxhsKU5PB/oi0p0ewy7BgF0qhnPDmdbv4xz9S7x7BRfkA+BPYEsnqHaJRYad64aElZ72HTWuVgUmFwRDM= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB5550.namprd10.prod.outlook.com (2603:10b6:a03:3d3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 00:13:23 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586%2]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 00:13:23 +0000 From: Mike Christie To: skashyap@marvell.com, lduncan@suse.com, cleech@redhat.com, njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 01/10] scsi: iscsi: Move iscsi_ep_disconnect Date: Thu, 7 Apr 2022 19:13:05 -0500 Message-Id: <20220408001314.5014-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408001314.5014-1-michael.christie@oracle.com> References: <20220408001314.5014-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d1010ff7-9be4-4c1b-46e6-08da18f49819 X-MS-TrafficTypeDiagnostic: SJ0PR10MB5550:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AMc65co97umOaVH8cCcH/87MUgJB7eX8wkHLKZNAJKAPkocnDbhe086u+0ipTSt7QZetMrABxB/3Lke2623kgm+hCC5nXh0t4gUIya3BecLs3gkjJ0Ziyz8BjJKdlVi64mURmtPknWRzWU68JWipJpnGIvb2hRXPYqCyW0NRUfZv+wAa893p/u0zz1A0XExUhnOFohZ21ZzF0C+3dVwYaSBzuCjQp0Z9BMMCX/kTIu6Aeu5aTGrYAg3jrhAaQfTtG86Dd05MB61kKig5GViXJJU+BfcLHQRok2ma/t6csAxBAnrVzPV1rqYfxTI3F09/jBmqjv/f+BjsSuf3mnD/Q+BEDmTQlsyEbetAnw8hO5O1OSz8CuK6WrN80iBrN15gYcU0XNydZKRBFwMwTz5MZHorVbqWniIf1BQnks/sKbYrrhjSSd+nDNRJPtJ6lsSMKbHj/EeerQAwOeY113iCNoT9H4AEmQfAbko0P19HR4VZwX8sR/HZXmS9zVDVq9OCo2A8clYSf2gJzSI/p55PL1+O6fh0SrzW6+vHWuO8w5qSPfQlZ+0YabcoCvOrF2dEzBE7kTIoyhXPwdATDC/54O1ksECUzuJYyJi/kVDq8ynG4MSlnUlNk5LeteC6RqFt5QEO95AwRVqMII16C6CI7wiUoHlcsQ/zsTflhefZtH4/zTIimz/M/ALICLK/jQxOn78nCr/Tv6bXrLaj7Sr34A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(8936002)(186003)(83380400001)(6486002)(86362001)(316002)(2616005)(6512007)(5660300002)(6666004)(107886003)(36756003)(38350700002)(508600001)(38100700002)(4326008)(52116002)(66556008)(2906002)(66946007)(26005)(66476007)(1076003)(8676002)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Hp1UXYN+EDLd1W6FceZmNJUlu2TxLPKHZaNknMemdUNO0vGYJJcsPVtDuEIFOP9bldmIc8duVDiU2a6MPLt7i3LsElqJyCd4Yl0MxeyGpOUCIL6SdntYx0VoWFgNJidfxVmWvVmIRE7HTkMg1C4NLC9LEjqrt5wQFrwCC3OX7SSDfGau7sTbFIh1VkOu4LrLCx5L6Y3VXkY48K5X/PmSIkctKeMLlo1r2IudgzHQIPhT8FZcufEkukDy5nDhn0m+31pDKiJnsYZmXp4+L8Cl5Cc/EqwiR+W3IWJ4tjxd2P/ifElb++qwflVR0qV7IwxtyG+NS17xfCUG3KrfpIr64FstZ1eMD00oiHHVvpS2OcKbAC7D76XMyiaON0brF4uENj7tVcxiR585E5h8G0Y1V8tm5YtovEEP/3K0vIIQiiPBPs/+eEpZBMx9VXtFr5+k0Ufw6DXRk3GHuM6cUCP+7eIsDZaRB5Kx4OPYaZdkHiOvj5rUk1Ur5g7t+5/xir+iMJZLErBySSpQqsoJnV8Y6br10myLQk2uMxDOwMTj0k421nIZl+rHVRA9G/N5j/xvm7Di1wi/KuQMWAQsdDVcR2DhBzepSvws5ZDC8NuLSDlOgy5NC/lYg7ZkDaBmm2/Y8Mp7Xc95PQKVwXJ/nWhmElf1mYgSZ3oGJRAq+zX0YYOi5dmaHvVEzFOmrHOKUlPFjAlLQ6DFG4tQs/dZcmESRUGtrjj4TIrO40GZ5EXHL9NTxEc3H8g2r3f/WFIU10d7UBWFQ4JSn/4LgKF1Q1WFxuTbdsCjh7q4fLtsP9UxLmFR3fVDcj07iFdWrgJNL8jp2IexjfKPOQVmBmz7aUP+JdC3WiHf8EJUwx+G826VB9Ii23xIfrcAzWs3p01XQ+MFenHFgsgUQxEhpTcZbcNaPRpCPWnDdssoFU86ou/FUStYeEXd/IHrw382TamHtM5ndljuPfM3vfBE6HfrQM0OFtKcyD8cQxduTXZSGLFvy2UeFQbA8Tmptuuu/X9742Y58r5qxH+6ClpwrbajzkRmPqtARWXg4cVVCN9DgLgmq/V1xZcK44FWWRdKwXDzt1/fsJ/tFfg89slxFD+z5uYvldlJtU4ZRi45Cw/c62hsRh4UW7VmdBX/oTko2WRXrPDsOxN99MQRDZvQoaZOX2cJSiGfS+dQm+Sal6iEKB7gpW3K7L8x0iDr/zFquIqcoMd+RBf33UgLfY+U8WK8Fk9Eut3JqbHaVKkhyXqqgKo+R1xRSq83TLSFEw99QQJKSWh+oOXx8/MuMbEf6HeLVXO43ZBYH2SVirdhnJc2z/4Jlugj7B0Z8CfdMwhzMZmlqdQfedno8DvyRbg9ephkZ61ACIQRsWkIAwJopb/8wt4CcAfpephiR3Mpv7oN7N344tluP4JRU/S6tnlUhPc4724CXz3RrOy7Q8+b4tyKwJkyV1VqJcFD/I4711vFxB41Abl5yNdR4VBb9Jv3SK0PRXJIZkcwlXjy8v9+/GpwkWIwtMZr1jSU1nammAS+2/7Vj+11R8ztpceJfJgQe3SGJWJA7W887pB5R1afIgViyNmgMnGr4JQmIYVePULWfr5jAxptWB2NMiHKuU41Pj3hCIAXogBVi79np+fdkF+fHY+pQpSWAG2WxvddIVf6Xg3ubDUoZSYQVrtMa0HZPBBHtPJ9GvEoyXy4eoIvZQ5EJXiG+6tkn72bXPxkAZ6bl+3+oGfWmYABJ/lR2PoWdmEvg0hYDZfUP8+elZi4xgGxXBHpTTM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1010ff7-9be4-4c1b-46e6-08da18f49819 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 00:13:23.0476 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K5icfikfNI+4Yqdh/1KR7FYxWckIdudn1z0H0dHSolQiipQsu/1fsNRpAtqYN+PAdFP7SJWAxYWdGudxOwp4vqaSXxKeTSQMOtripTZCtqo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5550 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-07_01:2022-04-07, 2022-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070064 X-Proofpoint-ORIG-GUID: sSMkPlWYAsMmaUWoSisU3squBjmIP1B9 X-Proofpoint-GUID: sSMkPlWYAsMmaUWoSisU3squBjmIP1B9 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This patch moves iscsi_ep_disconnect so it can be called earlier in the next patch. Reviewed-by: Lee Duncan Signed-off-by: Mike Christie Reviewed-by: Chris Leech --- drivers/scsi/scsi_transport_iscsi.c | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 27951ea05dd4..4e10457e3ab9 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -2217,6 +2217,25 @@ static void iscsi_stop_conn(struct iscsi_cls_conn *conn, int flag) ISCSI_DBG_TRANS_CONN(conn, "Stopping conn done.\n"); } +static void iscsi_ep_disconnect(struct iscsi_cls_conn *conn, bool is_active) +{ + struct iscsi_cls_session *session = iscsi_conn_to_session(conn); + struct iscsi_endpoint *ep; + + ISCSI_DBG_TRANS_CONN(conn, "disconnect ep.\n"); + conn->state = ISCSI_CONN_FAILED; + + if (!conn->ep || !session->transport->ep_disconnect) + return; + + ep = conn->ep; + conn->ep = NULL; + + session->transport->unbind_conn(conn, is_active); + session->transport->ep_disconnect(ep); + ISCSI_DBG_TRANS_CONN(conn, "disconnect ep done.\n"); +} + static int iscsi_if_stop_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev) { @@ -2257,25 +2276,6 @@ static int iscsi_if_stop_conn(struct iscsi_transport *transport, return 0; } -static void iscsi_ep_disconnect(struct iscsi_cls_conn *conn, bool is_active) -{ - struct iscsi_cls_session *session = iscsi_conn_to_session(conn); - struct iscsi_endpoint *ep; - - ISCSI_DBG_TRANS_CONN(conn, "disconnect ep.\n"); - conn->state = ISCSI_CONN_FAILED; - - if (!conn->ep || !session->transport->ep_disconnect) - return; - - ep = conn->ep; - conn->ep = NULL; - - session->transport->unbind_conn(conn, is_active); - session->transport->ep_disconnect(ep); - ISCSI_DBG_TRANS_CONN(conn, "disconnect ep done.\n"); -} - static void iscsi_cleanup_conn_work_fn(struct work_struct *work) { struct iscsi_cls_conn *conn = container_of(work, struct iscsi_cls_conn, From patchwork Fri Apr 8 00:13:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 559130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B8BDC433EF for ; Fri, 8 Apr 2022 00:13:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232758AbiDHAPv (ORCPT ); Thu, 7 Apr 2022 20:15:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232723AbiDHAPk (ORCPT ); Thu, 7 Apr 2022 20:15:40 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24CD7108BC0 for ; Thu, 7 Apr 2022 17:13:35 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237K03I4006381; Fri, 8 Apr 2022 00:13:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=QYrbjuf/7dCkfyxH7xxQe1KsJ3diLh/uD6YvZV96w/U=; b=y25lwYzgdXG+hocpGPFHQF7id/+QBhmPM2rdC9MLhbaGBgu1rNZEcj4gb9eriJwTWB+Z GZXilDhKuycQuxjS4eFnOtQy68SUNSqfip4sF2jeyJ6lYLjMaC4mJ4EcSZ2l/gH9eTXI 3HTS8djqq7e4vm94UqCC3b8Jyjhz7Q/4/jD2N5YubNeDsYzNMq/WZDcpT5FKJZm3L08B J0QO/at4Yz8qOeskQiePjNsJEaY+vCcDRRX7XoBV3Oirvdf0V9uZKPU2CmWr3jh/+99X YhDbEvozL7cPzFagryP71grsP1EQZrlxAXcR3oN99Oyjj5BLTT4AIiS5lwqHE/MjCGfZ dA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6d31nh88-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:26 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 237NFHE1013838; Fri, 8 Apr 2022 00:13:26 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3f97tu11q5-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S2ZfbJNthVWcgC3Z18Jl2KVdk0aAS5xAA83BImN0iDNZkzQxIdFDu0mnx1OVQcn+OORveL7Iqmw9PQ6C8j5Zd87kpfniQMyzGRYjjLSraRho9zqEG5UfAhoqrhM3d0su0g21NueDwlqsuJW+wIky+Kc+4OFthG5cW7nMk8zjX2rimYeDW3kcdkytBWZ27v2LRFoQ4RbRY7MWEU0/HxfNi8STt+sCzAoAAcsF7vHBrKKWvgxAfhm21pBFbH4X1JxE4tNo/MdxZvuADVSFgcVW0yQucqQF/8kHJKQQHFmsSmHfogvOAEULcqBKw3Oni3hFAeMMAqF8kY4br3xKOdjPaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QYrbjuf/7dCkfyxH7xxQe1KsJ3diLh/uD6YvZV96w/U=; b=iK6SR1I5YhZvNRRpEddPHT95qrNbCCWwQcIaL42b0VWRm2/Rs6gPFCvii0o4YJT/vysqtzhv+YWAww1u439LYRS1hKgLbI1UE4ST7ncXDh3n2mO4dOD9g8wpNlS13iAEwSglrIboaHA9MBpFC6kaEu4t81+HQMloWIHH+HfdTPiFoOKfvpt+IcybVyBBAO5rmIB3eSikrOAWjo72DnixukrggG6H14CM8i4NWgF2oGiHPsbi/zJO+N3q4bQFzD73ARbVzB9pPw1lM/X+mzCSht8SAgcOh2BUD03MsMujEcvitOYGVlXdviNbUh7Hte0Ja2YILk3IdFCjtHAjk1w1hw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QYrbjuf/7dCkfyxH7xxQe1KsJ3diLh/uD6YvZV96w/U=; b=hT5fUMrXJQsf+HMoi7CENn/fE9XrZb+45q077zArYKJk4ZjCABOsIRtcQ1eMaZ+65ocX2haQ3bhi/01TJ0m4aDSf5k87fAo8v6yleAf1miChF2mcah3XiCKro3yqHyYzKXPRGCIY6XGvKCl6/0MJwqctKkj7E/KaBKrEol/eCsA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB5550.namprd10.prod.outlook.com (2603:10b6:a03:3d3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 00:13:23 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586%2]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 00:13:23 +0000 From: Mike Christie To: skashyap@marvell.com, lduncan@suse.com, cleech@redhat.com, njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 02/10] scsi: iscsi: Fix offload conn cleanup when iscsid restarts Date: Thu, 7 Apr 2022 19:13:06 -0500 Message-Id: <20220408001314.5014-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408001314.5014-1-michael.christie@oracle.com> References: <20220408001314.5014-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 373573a9-deba-4708-cbdb-08da18f49860 X-MS-TrafficTypeDiagnostic: SJ0PR10MB5550:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lICW56pDPEvqhL3vN0zx5UTVAWocWlZeJ+VnDZmKFgPfVNqn2WCOnAbg+H5pOA8N1bwJ6E1TZqk0NpoGhi8kN5N1EWTHIHXfAbJWFHEfXJ0p1yi09lPnMMne6ChbgvgYygc44wj1fUXZ1zf6Dn/VYgJU/fy85kC9lm74eAVQfvXOMGuDwscs/QJhOzUIJvz+dpMBUFiR+5Ac2sgdX7PP7wAtFse1H0p2VO252TAvi6upsPGwxnmmdwx7rjqMknsEK4pq6Vm8+cQQDcmcXvmBIJaVNX1iByBk5dZvsS5OFhPuqTDbEkrCAWjH85dfL5QdlOuLyC1J2ycN6pLRGPConGiqhmrYlbG9SxVy7LjwAqoH2lMceEl+423j26+pxcgFAKA0jVamJnU5VEswLkCStqVzMkftEgtJz4ooDQmDg0BxCoVJvZvL9NcrTXSdIMKcT/yxwmfDi8rMbxZCU9j8I5TeuiumpBeiFGTUgflkuLV1TF+o7Sf4tq/+XG1ASQ1EbL8Lyg9No9GC4xlEQ4TfR72PlgAIC2Sv/m56TJbJngu9MgoswdjUE9GpCwwi9q+4cKa/1s9M3WbWyLjWpcT54eZXGVjXO1fW0WOwhTDiNLll82IiKfOYx7GTcQyga0Vu4CsLGXfKUULIryOt8cPnVFp7DSyCr45uzonpEJ5orKRtI0J/r2ZI8QIdypRiU48OApDzeBVoPFc3Pd/O0Gt56w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(8936002)(186003)(83380400001)(6486002)(86362001)(316002)(2616005)(6512007)(5660300002)(6666004)(107886003)(36756003)(38350700002)(508600001)(38100700002)(4326008)(52116002)(66556008)(2906002)(66946007)(26005)(66476007)(1076003)(8676002)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l+H+SuKY6S6ve/ZdWlmZdTcDMRE2Dl/117Cc4jH+dPOSi5/YOxprHrq+ID3AySUEY7PHU0AAtZZNsDHsTsmaTKV7ixsn+1Pcd/KI6Xf0tJbsRIEIfK5dDYbvIdiD+qvJfxpJFv3LCpxa0hgJAh+w5if+5MgHij1E0rQvxCLR+9dXQBiosU0AFZBGjrWAo6myRyheDHnezrOAiiae6+f+vhcSUhnkUjCiMylpSuQoTee3z7M1lHAuSwQq6tnFzNtaatswmJ39FSrjHOsl7odEZQvFXMFdIXzfBNuy783cVOvgBcd3+K4d9Lo2rZZC2andZbtFOLL6P3HKDQSvVOZgp8xs2In6ksuWCaJyxjqd2oNHB4hlEBKbQpD7lFWaNz14BoPBjpB7mVA+4Ne4StX+kFLBh9/anq50hdB2j3/hYDhBWLD5XWtrlQpre3/aoGqmx22XEZ659ZefP2uDkBnpYyc8u+5S+TBtrAHWULm20fTlLHINPb0OZG1AgkPKgjloTQPr1is28SbhEq/F0+QhkIomGhwy41OCeNwmemjsIpUj2p8K+gJsl1gL/bvENvUeftR8KshJQ6i3GnigII+0CtP9I0c+0JqN40oTGEYhwHMh5e66GdgthSRNbxGtGV2fz4XDbP8YIoTn5YwK5lHg+fJtBPjnm6te0hhO3e5HB/oOfqO/EkkyTxKTB8Q29MnoxV9EqskWAqCoy4ts8Yz1CQhXTrtoRlASKgLzm5jPtQITYgg7D1/f8oxP/rcd46172gL5oNwh6gBZ5DqwctIfvxIqlC9Hgtw1wkbArkRK3hLrhH1fOJP9S9F7fGuhtTUDsbz/R1eXwLcVG4yzhOMhstiEbhY0Lk+WK743qgn+GqvFDKUznJf6R5DpJRaklf6xxdsrQM3GFuS0mGM9ZB8En8wAwOvS/QeDpjXrkY4RltE+sw/tbcPnuYWWqL9Z0aAeSuXOOMIs/ncQI/pDZK7zEjD0wfM7u5Zf+bqGd+Hhb+/kOBjAhQWO8kOpjL4SwPw+pSOCDbbHW2SNsEQzqCgAGrL0PLeKwP3Dk/TbpX7XdawxqRGBeb/KV++IcHH4Ldpkv3ueS83YavpZP+KR4qmBPiALKhekuSlah7m1Bm/wWVxkrMHyAwUikJHrRcYM+fYYYZbcODqjEgLlr6Zj3q2r0u8/ARNo6/0kjcMGMQSxnj1X7YE/3zkBmUwJtJfZZzl5+0blF8k3S0qWk9FV4Ohqt167BdbOyE2ySftrkJJkA/bDjK8fET7IxoFQuveWfw8DM97UjjwolXyfKgRdmZvXy7PqhJe5UGj5qLI34tm7kRANM22td/qUN4NQ3bX8bRHq66O0ifRiULBF/n7J+K7wZhpDjSeKcg596SENReISrXVzcJHCNNH3jxVvQJZna46Jw0k89qFs84LWVVJ81J8bsL3hbgbjeChdY4/y3ovaLdYkbHFrEUXPiP4UttN2rM1CUATjsUl7t99BCGW11SKAWCnEl6zObZ+NqhWO0HFTpWgGhQroLimDWLbF350AebL/6+9uvpzZXJqMngADGYmg2ucJIJWlldmUQ8WN3mFCwhJc2/NNHTv67/GyVmkzSoFMHOw+G5GNuLkxLrEHlyH1cF41MMg54zPZotMg9l4yhj091ZueeYk9at/02UEz1M1BdD/myNfgBxxTBmxiMNUASnAKX23cigSe3JODDEnMlquCxmLghsFR6q/gQuQwlPCSSlae8Uo0th93+LBsOv0Wfe9rBw94wU0WhghaucHmluI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 373573a9-deba-4708-cbdb-08da18f49860 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 00:13:23.5476 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LXtyF6CojhVFDsJd9jsJWr+iz5RjAwet3S9j2pmksa6I30g7B4kLJYKrJC5kYLVwN2mjr/K3aR8Wvkg/fT4zHrZax0MeMKoWJsG9pFks4BU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5550 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-07_01:2022-04-07, 2022-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070064 X-Proofpoint-GUID: JcgFccuT-FE9kyE6_1xl2t_FJi5YWkj9 X-Proofpoint-ORIG-GUID: JcgFccuT-FE9kyE6_1xl2t_FJi5YWkj9 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org When userspace restarts during boot or upgrades it won't know about the offload driver's endpoint and connection mappings. iscsid will start by cleaning up the old session by doing a stop_conn call. Later if we are able to create a new connection, we cleanup the old endpoint during the binding stage. The problem is that if we do stop_conn before doing the ep_disconnect call offload drivers can still be executing IO. We then might free tasks from the under the card/driver. This moves the ep_disconnect call to before we do the stop_conn call for this case. It will then work and look like a normal recovery/cleanup procedure from the driver's point of view. Signed-off-by: Mike Christie --- drivers/scsi/scsi_transport_iscsi.c | 48 +++++++++++++++++------------ 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 4e10457e3ab9..bf39fb5569b6 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -2236,6 +2236,23 @@ static void iscsi_ep_disconnect(struct iscsi_cls_conn *conn, bool is_active) ISCSI_DBG_TRANS_CONN(conn, "disconnect ep done.\n"); } +static void iscsi_if_disconnect_bound_ep(struct iscsi_cls_conn *conn, + struct iscsi_endpoint *ep, + bool is_active) +{ + /* Check if this was a conn error and the kernel took ownership */ + if (!test_bit(ISCSI_CLS_CONN_BIT_CLEANUP, &conn->flags)) { + iscsi_ep_disconnect(conn, is_active); + } else { + ISCSI_DBG_TRANS_CONN(conn, "flush kernel conn cleanup.\n"); + mutex_unlock(&conn->ep_mutex); + + flush_work(&conn->cleanup_work); + + mutex_lock(&conn->ep_mutex); + } +} + static int iscsi_if_stop_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev) { @@ -2256,6 +2273,16 @@ static int iscsi_if_stop_conn(struct iscsi_transport *transport, cancel_work_sync(&conn->cleanup_work); iscsi_stop_conn(conn, flag); } else { + /* + * For offload, when iscsid is restarted it won't know about + * existing endpoints so it can't do a ep_disconnect. We clean + * it up here for userspace. + */ + mutex_lock(&conn->ep_mutex); + if (conn->ep) + iscsi_if_disconnect_bound_ep(conn, conn->ep, true); + mutex_unlock(&conn->ep_mutex); + /* * Figure out if it was the kernel or userspace initiating this. */ @@ -2984,16 +3011,7 @@ static int iscsi_if_ep_disconnect(struct iscsi_transport *transport, } mutex_lock(&conn->ep_mutex); - /* Check if this was a conn error and the kernel took ownership */ - if (test_bit(ISCSI_CLS_CONN_BIT_CLEANUP, &conn->flags)) { - ISCSI_DBG_TRANS_CONN(conn, "flush kernel conn cleanup.\n"); - mutex_unlock(&conn->ep_mutex); - - flush_work(&conn->cleanup_work); - goto put_ep; - } - - iscsi_ep_disconnect(conn, false); + iscsi_if_disconnect_bound_ep(conn, ep, false); mutex_unlock(&conn->ep_mutex); put_ep: iscsi_put_endpoint(ep); @@ -3704,16 +3722,6 @@ static int iscsi_if_transport_conn(struct iscsi_transport *transport, switch (nlh->nlmsg_type) { case ISCSI_UEVENT_BIND_CONN: - if (conn->ep) { - /* - * For offload boot support where iscsid is restarted - * during the pivot root stage, the ep will be intact - * here when the new iscsid instance starts up and - * reconnects. - */ - iscsi_ep_disconnect(conn, true); - } - session = iscsi_session_lookup(ev->u.b_conn.sid); if (!session) { err = -EINVAL; From patchwork Fri Apr 8 00:13:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 559407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C323C433EF for ; Fri, 8 Apr 2022 00:13:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232757AbiDHAPt (ORCPT ); Thu, 7 Apr 2022 20:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232724AbiDHAPk (ORCPT ); Thu, 7 Apr 2022 20:15:40 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF8FF132E8D for ; Thu, 7 Apr 2022 17:13:38 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237Mi1qN014716; Fri, 8 Apr 2022 00:13:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=1M24vPleLG7MciYUETNjK2/4kmRowB1PxA1K4kdm0a4=; b=wdfZYnFF+RK87ldQk3VXQ0oe4syi7dbZGf/WbocD+xPN76O5EV17tabezr/+Q9DUebsE HMdJrREqa9hCrqDyY904kh+XNrfGOPseGReraEfmuscV6FP8YQNw1YBY4seCPWOV2ZJq YcJx2+AkSY/tYyUFxisg4WuDxSYBJv0Eq70YDwIiW7HHib6YobX2ZkWfP5Kj1c5RWc4s 0ZivY7ITQX6pKVF7AdnCaCAuEfst3Na9BOZ0nG9mdNqihXHMRXKVhaJvKzyOzYsuNMy/ /FvFfhiIrn1x/jku7bs48ebVrnrRyi2aT7ea8Qw6udONUvc/75Ax8gYFqtqeKNmWXAKR tA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6ec9w454-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:27 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 237NFHE2013838; Fri, 8 Apr 2022 00:13:26 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3f97tu11q5-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RxWG3NVTtpUYqNrCGmgB6MuAoSXNi5e7oSNYoJnke9VFYR5xQaVuvhtRsBUWJU3pbG8XcZHwHJwD3SWjHi5iVhOx+sK6veI0kPvJ84cUXn5s9CaJ4vI+4hyxh3xZbywV4Xr/7z0UGEKL27evFC39LfRRTIvk0s2y0iDXrn1Jrqx/ILfjW3/rSv9pxrbhcyboUtrSpdHIoiMZBeSAPwtrPLrAj+smJqZwsPvr4R5EEMuWu5GQtZKYlC1MnGj1C+EY3yZw8UguwfU4isHcg3+/IhBcwKkRwtdUTRo6bZ3wAEBlO49tYb6PhncvJlIlwakBEz8MU3SV3kyxfoojdwXrpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1M24vPleLG7MciYUETNjK2/4kmRowB1PxA1K4kdm0a4=; b=SoPBHTaFImC8rKLyy6/Qm21DKFvPpPImLHNW5Cvt1IjuA80XhixbQPoW0edZUuopay8jGjS/fR79MPxWAOfmhyDPMjMDR51QPgiKOxOpmSurLfSyUh3nyfq1sYTSo3Vy+drhVWNhUEppLNVQYNhizMYNK7LC55bnuE8AsiZlxL+ApZk5TeSS6xdUsafCkllLXEN62/3bielDERhEkz25buotNBdIjq664Etp8U+YsbSgZhO+LYq9rtD0CnL3S9zmCcvigA3AqQPLQ3wwRNRjF69n5o8WE+70CQ/BMfbJRaA4Npq/8Fu28LsWKLE6eDoMQzfB4QK4IQWwb5LJIktgCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1M24vPleLG7MciYUETNjK2/4kmRowB1PxA1K4kdm0a4=; b=T8oPalAzQXTL4yz0wJLIovUyAZgQq+0FTPNnwtOd5zzbC2+vgo16z9VBNArm9IIhzONrcPIATV6gJ417ZCNb5gtWw+nxGmcNPk9ON5LqbeLGAI7RTu3ei0ZCBB+3zpHkmvL2YAIRDTtauZ/Y0+VZWVcF85dgWY7bDYgslMEHCnE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB5550.namprd10.prod.outlook.com (2603:10b6:a03:3d3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 00:13:24 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586%2]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 00:13:24 +0000 From: Mike Christie To: skashyap@marvell.com, lduncan@suse.com, cleech@redhat.com, njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 03/10] scsi: iscsi: Release endpoint ID when its freed. Date: Thu, 7 Apr 2022 19:13:07 -0500 Message-Id: <20220408001314.5014-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408001314.5014-1-michael.christie@oracle.com> References: <20220408001314.5014-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e819591d-8d4a-4e6c-77ae-08da18f498af X-MS-TrafficTypeDiagnostic: SJ0PR10MB5550:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4DJvJ0R3R/9frL2HGytNdh5ovycTWELZ0+akv0VhMWibIAjNShzQSPUWKxNmfDmOO8hYFrzEIiWmcmPUuIM/5SHINoMVk9rY5Elooi0uVt9Q7tGCL08QJ+2ZXCTQsqJ50loaEIEBY7oJJKGJwGOSvtV82ykl6KHcACAbgDH6CQLrtys5U9kau9dXsxHsdR8q1h7L0H1lobGeXc8MfmtSwJxfBXRiJW7FBowQ4Bmxctc4a2P02+doXQuQBD5dAKvdWumxMrJWCN2EnxwJ87qmYadFWYrsQnFQib+uUPlNw18ZQ4hOWe5be6VkqyJgsTtYZqDkZ93q9hupr30AECUbj5EhvS0OpUcEsKo7lYxEdWwTetZfZWy6M1ot2gSTCGHEut3mKxUo4z1So7ZxrldhX6yks38U6LLfSbbAqEMWhp7DVngkUaAGLslVAaPhB/1YNLNHC7HFZxJqMxTlrPM9LyNlNCrCBVQtDYiGDRbqwuOZxt53Pi00y9ItqwIq8flu8x6TqLBKImtlSnrAE/xCTLiz5uhSRWyPsd2gfG0MRO1tmh7+FdM9aqTgnioB6XsH1nxwqRQx6y5M6wj/kuL4ahKI6xuYPxkcaOmpXPzOn0NuZlyWAsC4jQp/WJb1w+LKZJxpq1FYECJwkUuL4mjemyi4/f4mvbWiqgetsFBwSQnQvcMFeD2h8huMPvvKtoi2FIaU4sTlS3OVLYMHgaVj/A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(8936002)(186003)(83380400001)(6486002)(86362001)(316002)(2616005)(6512007)(5660300002)(6666004)(107886003)(36756003)(38350700002)(508600001)(38100700002)(4326008)(52116002)(66556008)(2906002)(66946007)(26005)(66476007)(1076003)(8676002)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: acvVqANEn6yq/Usu8d4Mg2RP9YdyTE5gYCHjmeq6O65SPu8z3x/agpc7z/f5GMe38kY1wxfVbayQOEC5noiUlonehEMf5FvXkGjG/vmi5mJcwKgJeP+c3m4nb6CLR9aUKHbs+4XZZP5jFbHp/l65Pr50cV0uWLk0SgtokyDWXHwi7nghC0fk5uGH5DJizjXyj6T1MtiL0xKDSuIa5aKQuGJB3/sFdrZDci+i6V36XwTfHAxzQRzsMX9k4YtOr4Mn65o32/K9W/UncQUS8UTdL0B57T4xD85IRyrEqMzV1ABB4352MckbiirdNy++0OGBxPEaawqakUR5yU/0qfXFdxEZjV7joR2XmvoQUlrdHpYcAF8EWJMYq3hdJ5uG1bajCGp5oKH6D931PMf5bpjm3YKk7dShUmnZXNanll3qE9CiYINAmE6FrZErQ1UNs1nCW4CudQelkH61dOah3lcGyMrq0OGig0jXJFw3747JNnjIK4MDkI8cL2QRXXvdstswU+j+tYxkwSZ436Gr5/WoWPhRuP9FSWNdUeTBKLerNTKnTI9NYas962XWEfvMj8YBhc5oCMb5Ra97Gy/US6AiW/H0Vw2WUEzi2H73zM2qye3FxO3KvOnGsBHLWjQgO+eyTnMJtUcQ0g8nf/Yka8O4CqjzDS66fW/JvJL7lNUBc56lfMnjtZ30U41KH0xQvmZpGMu62838P6zYNrprANxtzJsqhdyiEvowRbpiMgLa3Mhd9VYL02opqS2UaJ8djm30MdM74q6Ye1/dw5WCENAr20fBy5KNpR8ujA/sQHk+HKOj8OSngrMvWuz4KDhQqcZyls0LU9vlBUhJHUxoTP2evfUtNW+BaH9+cKxzyO1sDRIIiSD0rLH0yGqCNtgHWSEGBGQcxy3BF21J80nKUw9oKfsFnz5d1vxZp2gjSXhIlzatkhe9cTV3+BUW9iucUc1VmJkGbU8CpJulfAQdOWmouQeSAOaiMt/aCaXHeGHLlaj1PHzgPncfwq0y2JT2Il5ZC6a7LOs1EI4qB6gLGLpW8xW43uk1iow3bpgNBaxmK6tWztfi3HfvRdw5W8BwSM5tEqW3zcwD8VQ5YJTQU75UdPpfpS/nwP3UwaxKW+VOpzSudisDoP229tIPykdFpGc63t1GO01WaS8qjyjbHrfgUc7z7EbalqquetjDCcUskd3j3nePMqILP56XOJRecU9PlbOVMwQpJGug6ftobfo73Gf8runz6vkkOSP0jZA9WMGmrnwkgPhfc9cAGqhXn1MSrgFlG+lsMtL07Nc87dYahSUGQGEo/lswQ3MVi6ypZyLLvnbjWAu6VI/FFO8NsjHi74ES9kK7yWKb7v+VVuTcRY/JpNFS3ddqDPjSnjc/ZQCKa9NlvfUwEPoaagoRFC8va4Z+abIByBSJSu3u1alNqilGrrYOIS0rGJcJ+TPhSnKu6VFliqKZwwC5eQ2DIpS96sse7Ytv8I74nda7D7K44FeTc5OBE9FYLLkk0pYnPF4T/Q/4oqVEXeoFHRoNZuiC8fHz0nLXht96QXNMzox8gjtRyCTxn4ZvXC4yT2MKX2r00o0N5z1UgWLqb/W40qH+O+ifLwXhl6iY8qIQy0Q1x44cCmMjcQMXHyU5mCr5UPIwbCurWPuyo9aQtMRm8eD8zS4LCY+M+FS8n8lBc6R+n8BWypsz7+1B04hU4LBTJQFmDwZPgjUpxDtPwSZ/gzqHrUJAwAeKLxe0cexwlhB1kjN46AWTrh8KL0rVAS077yk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e819591d-8d4a-4e6c-77ae-08da18f498af X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 00:13:24.0631 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2MxHDCtT095o9zsJxAnt57Gm9v9RasmmRKCur0rUwojEWA1DdCOa6J2I2sfeqlpeuTAEfy76Uwyc/9DYIB+rWvfZVv2qxm4UT5kpYcbw8wU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5550 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-07_01:2022-04-07, 2022-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070064 X-Proofpoint-GUID: iC2bSY2zOUrz1sAbZuduYmUPiZl7hHLo X-Proofpoint-ORIG-GUID: iC2bSY2zOUrz1sAbZuduYmUPiZl7hHLo Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org We can't release the endpoint ID until all references to the endpoint have been dropped or it could be allocated while in use. This has us use an idr instead of looping over all conns to find a free ID and then free the ID when all references have been dropped instead of when the device is only deleted. Signed-off-by: Mike Christie --- drivers/scsi/scsi_transport_iscsi.c | 71 ++++++++++++++--------------- include/scsi/scsi_transport_iscsi.h | 2 +- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index bf39fb5569b6..1fc7c6bfbd67 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -86,6 +86,9 @@ struct iscsi_internal { struct transport_container session_cont; }; +static DEFINE_IDR(iscsi_ep_idr); +static DEFINE_MUTEX(iscsi_ep_idr_mutex); + static atomic_t iscsi_session_nr; /* sysfs session id for next new session */ static struct workqueue_struct *iscsi_conn_cleanup_workq; @@ -168,6 +171,11 @@ struct device_attribute dev_attr_##_prefix##_##_name = \ static void iscsi_endpoint_release(struct device *dev) { struct iscsi_endpoint *ep = iscsi_dev_to_endpoint(dev); + + mutex_lock(&iscsi_ep_idr_mutex); + idr_remove(&iscsi_ep_idr, ep->id); + mutex_unlock(&iscsi_ep_idr_mutex); + kfree(ep); } @@ -180,7 +188,7 @@ static ssize_t show_ep_handle(struct device *dev, struct device_attribute *attr, char *buf) { struct iscsi_endpoint *ep = iscsi_dev_to_endpoint(dev); - return sysfs_emit(buf, "%llu\n", (unsigned long long) ep->id); + return sysfs_emit(buf, "%d\n", ep->id); } static ISCSI_ATTR(ep, handle, S_IRUGO, show_ep_handle, NULL); @@ -193,48 +201,32 @@ static struct attribute_group iscsi_endpoint_group = { .attrs = iscsi_endpoint_attrs, }; -#define ISCSI_MAX_EPID -1 - -static int iscsi_match_epid(struct device *dev, const void *data) -{ - struct iscsi_endpoint *ep = iscsi_dev_to_endpoint(dev); - const uint64_t *epid = data; - - return *epid == ep->id; -} - struct iscsi_endpoint * iscsi_create_endpoint(int dd_size) { - struct device *dev; struct iscsi_endpoint *ep; - uint64_t id; - int err; - - for (id = 1; id < ISCSI_MAX_EPID; id++) { - dev = class_find_device(&iscsi_endpoint_class, NULL, &id, - iscsi_match_epid); - if (!dev) - break; - else - put_device(dev); - } - if (id == ISCSI_MAX_EPID) { - printk(KERN_ERR "Too many connections. Max supported %u\n", - ISCSI_MAX_EPID - 1); - return NULL; - } + int err, id; ep = kzalloc(sizeof(*ep) + dd_size, GFP_KERNEL); if (!ep) return NULL; + mutex_lock(&iscsi_ep_idr_mutex); + id = idr_alloc(&iscsi_ep_idr, ep, 0, -1, GFP_NOIO); + if (id < 0) { + mutex_unlock(&iscsi_ep_idr_mutex); + printk(KERN_ERR "Could not allocate endpoint ID. Error %d.\n", + id); + goto free_ep; + } + mutex_unlock(&iscsi_ep_idr_mutex); + ep->id = id; ep->dev.class = &iscsi_endpoint_class; - dev_set_name(&ep->dev, "ep-%llu", (unsigned long long) id); + dev_set_name(&ep->dev, "ep-%d", id); err = device_register(&ep->dev); if (err) - goto free_ep; + goto free_id; err = sysfs_create_group(&ep->dev.kobj, &iscsi_endpoint_group); if (err) @@ -248,6 +240,10 @@ iscsi_create_endpoint(int dd_size) device_unregister(&ep->dev); return NULL; +free_id: + mutex_lock(&iscsi_ep_idr_mutex); + idr_remove(&iscsi_ep_idr, id); + mutex_unlock(&iscsi_ep_idr_mutex); free_ep: kfree(ep); return NULL; @@ -275,14 +271,17 @@ EXPORT_SYMBOL_GPL(iscsi_put_endpoint); */ struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle) { - struct device *dev; + struct iscsi_endpoint *ep; - dev = class_find_device(&iscsi_endpoint_class, NULL, &handle, - iscsi_match_epid); - if (!dev) - return NULL; + mutex_lock(&iscsi_ep_idr_mutex); + ep = idr_find(&iscsi_ep_idr, handle); + if (!ep) + goto unlock; - return iscsi_dev_to_endpoint(dev); + get_device(&ep->dev); +unlock: + mutex_unlock(&iscsi_ep_idr_mutex); + return ep; } EXPORT_SYMBOL_GPL(iscsi_lookup_endpoint); diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 38e4a67f5922..fdd486047404 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -295,7 +295,7 @@ extern void iscsi_host_for_each_session(struct Scsi_Host *shost, struct iscsi_endpoint { void *dd_data; /* LLD private data */ struct device dev; - uint64_t id; + int id; struct iscsi_cls_conn *conn; }; From patchwork Fri Apr 8 00:13:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 559129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A243AC433F5 for ; Fri, 8 Apr 2022 00:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232734AbiDHAPz (ORCPT ); Thu, 7 Apr 2022 20:15:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232747AbiDHAPl (ORCPT ); Thu, 7 Apr 2022 20:15:41 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A98BD139CF4 for ; Thu, 7 Apr 2022 17:13:39 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237LnPHt024458; Fri, 8 Apr 2022 00:13:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=z+lctUVErpsTecQfCfrfieXbpW1F2dOzinioKIa/hU0=; b=SLQAzCYvpqcsZtlwNn4aygi94Q1kZm3gtu3NLqpkeI/6ErCticedNyAwWoZ8I1y/1BeO kSy/Xr06TwCP8hg6Gp6O0x6E74uOV396uuLVe4Xztl0FLtAX8xLQF2DiB6zxox75MmL9 MNQxr8OSxKZEKOctXZvEs5ZcvwKbUFcdiK6v3No/Jm5hSxT0ftPGB3XgxveVOu7jIZ72 Z3JbCWB26QW2AzwUWNsn2V+0FqCYUgkumUcb+Bzbnb/m4iiBUhZzDmyDn3gGBaNTekZx x4OqIFIHLEat+JK14nBOFh66NZwB8aPU0vXBz4KOSaXIWaa2LiufgxptdKXlSknEBia7 wA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6f1tdnhc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:28 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 237NFHE3013838; Fri, 8 Apr 2022 00:13:27 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3f97tu11q5-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NEl9gX4veC1/g/5uHMVABvWVkY/vsfSOK/LaJ13y3sv+FyDB2+CqU3zchS4nK2vbWxeq+3gTuNuyM6+ZOEDHcsEDXLidYzDvtk0N//gqRpfP/E3rrg3Ru3O9W0UNRkA6cxYM70hhkNStuxJ01XcW/uWvYdzj3xQhS45gJbtalXrxqaPh7/oty9axr0NvG2Anl8ygj6kCaagC6EEZp3vb9EzdNfuzqtXNB7Ln8bbjyMxjapDunCWTTeDpugzMIw18bUn/BuHSLE84OhGYwo6xS3Nzk8Aay/Nn2Vbx/ESVxVJ6/vNVAh2P3PeIjBdwMSx98cvPLP2U9GJePqtLa81EoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z+lctUVErpsTecQfCfrfieXbpW1F2dOzinioKIa/hU0=; b=H5RSfaIdSkhWKl1h+XmG6pmWNgcfGOj/iWejKNJCi9E9zevJcs2VMBNgOK7XlnO6uiOz4vXXNt6iinncm1MiCowJiLrQcv8TjSlB+OiGS6k4HEUZkCo0k/xJoK39DdTjZ+e4OhZTChfoy3nZk02/onIaTwYRmRlwjrVbK/QDx6aPLsTSehTBcrvzVAFgLagydp/yvBqmyUlap8mFm/NdiDeynvTfo0JAQYGnwUjQhvdSVzMCGnb9gUbiB24Onqsz6J+TO/r5xj4Fe2qByGr7XNE06+0efw5qbn+YNASYFz3BrpRk2FcylbdSHnvZpAuTecHGTerSpmsXiNW5GebEVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z+lctUVErpsTecQfCfrfieXbpW1F2dOzinioKIa/hU0=; b=FWtaHhmF+Jl/C2k8zlPiZsxW8euE1IB1a7FUQwnDtAlhSBHih8HQmB9EcrmPMOg2rEvYMW6/5UYvl6+3w7xzJlVAL/MPI016rf7Pz5vOQxIIH4FRQaFS3GA+yJVEDb3gej29HMqD06to+fuP0um7982RsWtna4fVC/5pZuqSM04= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB5550.namprd10.prod.outlook.com (2603:10b6:a03:3d3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 00:13:24 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586%2]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 00:13:24 +0000 From: Mike Christie To: skashyap@marvell.com, lduncan@suse.com, cleech@redhat.com, njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 04/10] scsi: iscsi: Fix endpoint reuse regression Date: Thu, 7 Apr 2022 19:13:08 -0500 Message-Id: <20220408001314.5014-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408001314.5014-1-michael.christie@oracle.com> References: <20220408001314.5014-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f4bd855-06ff-4e6d-5ef7-08da18f498f9 X-MS-TrafficTypeDiagnostic: SJ0PR10MB5550:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J3vGZgqmpWTrnyGnEz4fsQWv9cx4HbHBYfFMNPzEotXJHr38IMSmpLrXHKnb2GgfW7C0Vj5irGLRWV2f/mI4hWqyiWqG49aX+QfUDdN7R8e6QH23tbf4SmwCjaAQ+5ufBPvcltUQGfQqvNadH9oZjHh0aAaS1YEzuw1RyRfuuayumxUIceF7+gd+AXR+fFklw1icWZLhvNKAKY1rRKwTJ++E7FcNTvB+VaPHscsjbcJ6kG/t02xN/O9BSO9w0XnBlSuf7HE83WHLCG2mhOlNiCFJ/VGi7JGtew0Q6RQY0BekP1p3Yd9f1/VJHcPI0OVPI9rHE3YIyy8MN+Iwslm/DhtXZh2C8SFa3ESW1pbbnT8iLPq2PiSe1zaYcCaYd4PMXsVtf0LDlrtIHxjv9NytqQuJfAgreV+7f2mtoc3uJz+mDyd5wOTF5DKCpA7eTk66XU5XJ8+hpCEhuVcc8BnORA+1o7/vuNWLXczNPHK8cf4xePJgdX9O6qyGRJUPKWx1nGqu8RZZEFpv5m+uEZ4Z/bK+vGldirIRlhQ3N8yTc8P5iTCGfYFkrMdXk3EincTlJ572aPQPf4G9NxbCC++xmczzwNJ4Dx/+RNzHTN9m4AwqoO3oEGbMHMefgfFPr622tYbN1Ps4OAzw9ZYwzRze/IN5DKquqUMyE020DMVlGAbXk5LASdge6pzl90F56IpxM36EWDI2qKNaEM0EDmbK7A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(8936002)(186003)(83380400001)(6486002)(86362001)(316002)(2616005)(6512007)(5660300002)(6666004)(107886003)(36756003)(38350700002)(508600001)(38100700002)(4326008)(52116002)(66556008)(2906002)(66946007)(26005)(66476007)(1076003)(8676002)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pB/WUTdqHyil3f7497quVj0DRLkG+jNggymxBVXrT6AosKmlIh2MixWuI2eahcd2WnfTu4zCg3m/04CGqpiZ6wNaxGtGeNmImZUzzGNJ8rOL+oTacLbEcxsEOtlH+XTHKqhqaMXbfoxi3v9iSe5C97HeXXmNahbccQtcNfui0WLrygzqjENUanJBsRMEOGvx1T0QPKPU0zWKUvQ71u/mf2N4IzFmSxQHdMZqCxtgqhBWU9171HyukkKz3CtNn3VtTK0vKBe1gMBH4GfLUImZg7TxhZLr9SxnU6YKlW/Xuq22j2l/4fgqxn0BZLzbBfGne+ml9nLziKsOSWWF7u3CtHovs47g+ab/VopwYXlt1TvrlWU/kVYF8hMVKUKGUtz19oCdfzaouXr+ECFyA/Z/joA6yE29eRDqwCSKFoCH2v5AEi66jY5cVKCohquX6hm1uqdjQg2Ss6ZBWz3i0PMfNne5FCXAJ71sivnUvkM+9Kqzhh70jJac+X40qNpf6iNwQV7Q+V6nuLjWWIWmGwMd7Ubx6CwSjvJYJ6s+tB18JF3P9vHBUJr17m4COoa4I/vgV0GkdAGsQJJwM8mouEX7j5anlEqfZ6/YQ9fyKumRC3Y6gFm0u41WRw067XK5CwcX3edx+XsmUoQtAPPdOWIhQE94Jlo0e8SjKQrFGJWjCiy/3QEQnbjDFYAGw1PKihBTsGxbsB4fSCCAUBqVqIymRXPi+/qfSUaMQo/qjId+GK5Jwp4/b/CW+feb2daJggxD8XHl65eCT/qP1GcOrkw7YIqrlUBlCUPleyiQnnhrDIahmIcyv/Mh+n6sKutcd9EVVru+nuErgt2ZxB9ZYVh5+1vv2kt9G1xQTLYdxss0lGgm89g0tgkD6s/1vdL+2FrmBtjFne0rbzrOoZrIm+D3CUuK6z7B29OvRmQG9kJbKIqUV93xfKQXqculZZRehSAqO4SxrGiKI43L419CbMANhex8ZO/WDwXSwS8TrsaOuhYHp4R4b0OoYD1umKFPphCCe4RCf1rnofhNXluv4i658JyVFni18SQBypgdCCeU7wFYgKPf591M+rDBApmyhu/qxkRTclu/GBTogoYw8rvCLUT4cMbH7EhtspIyDSRb25DLVAazv+A9vqofXt1K6aiQIZsVAZaAoFl7OQd/dApKSVF807TK7OpQCbgLa+48kENWQBlxpLV4Ke+DT64m5NZlKeBKY6N8ZIGJMSdNzy2HG0RKHJJX/IBrHduxCXJgyJxS7S9KWVgnYuhiLnW0IzvIZOYWuiClY9lLVCYVKosGHrIoiAMue8IlfqMGNhVgAm3eB9mxnfI/IMsKUJCmzwwsOvriFhV0k0BKCMVUhROBFWVTQvELwzpVMJDKtccMsOK1XDyal7hT2dcr4YVgiAkBWRJrwelsWGVeKcovm7sNc0XDJ1zgK06toGmsLWDaYtKg5gy+hhOFh78ZeMtgQZZL6u+8zCu0EhHQ8lOAefE0hBQJGfaadJhWkdIFeFYCGOpmKx615sYG4HghTQS3UOcxI9H73/iX5ml5915S1URkV1aUUBuA0RTIKa4n1hoCln9pMdee404KZTiqu75qNTEzIKox6p1PLACFJk8CECtAleqwI7ZRyjIsX9tWWzAi+l64AFvN6+pnnHEs1TUl2OViyPPPJbaQZEY4iZ48UzbPOkrtfhivn8LzELS4StEmA+zE428EiBxcNR0p0pDEYE7G6iWS9NxezkUKz5LRxsV7jFZ5VZq0dM955kzzOW/n240= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f4bd855-06ff-4e6d-5ef7-08da18f498f9 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 00:13:24.5319 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gUl3UlGVeQvBXypA1rfpPC9GTvWDIzSz4UfAE75+eIZrQaWX0xpxc87qgGet4o1AqwQMi7gAAadUr9BLPPbAIkZ3Xkbg2+lWJ3V31v96d/s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5550 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-07_01:2022-04-07, 2022-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070064 X-Proofpoint-ORIG-GUID: 8lzfut8MROhrJOxTguynvVCathBbcnlX X-Proofpoint-GUID: 8lzfut8MROhrJOxTguynvVCathBbcnlX Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This patch fixes a bug where when using iscsi offload we can free a endpoint while userspace still thinks it's active. That then causes the endpoint ID to be reused for a new connection's endpoint while userspace still thinks the ID is for the original connection. Userspace will then end up disconnecting a running connection's endpoint or trying to bind to another connection's endpoint. This bug is a regression added in: Commit 23d6fefbb3f6 ("scsi: iscsi: Fix in-kernel conn failure handling") where we added a in kernel ep_disconnect call to fix a bug in: Commit 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") where we would call stop_conn without having done ep_disconnect. This early ep_disconnect call will then free the endpoint and it's ID while userspace still thinks the ID is valid. This patch fixes the early release of the ID by having the in kernel recovery code keep a reference to the endpoint until userspace has called into the kernel to finish cleaning up the endpoint/connection. It requires the previous patch "scsi: iscsi: Release endpoint ID when its freed." which moved the freeing of the ID until when the endpoint is released. Fixes: 23d6fefbb3f6 ("scsi: iscsi: Fix in-kernel conn failure handling") Signed-off-by: Mike Christie --- drivers/scsi/scsi_transport_iscsi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 1fc7c6bfbd67..f200da049f3b 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -2247,7 +2247,11 @@ static void iscsi_if_disconnect_bound_ep(struct iscsi_cls_conn *conn, mutex_unlock(&conn->ep_mutex); flush_work(&conn->cleanup_work); - + /* + * Userspace is now done with the EP so we can release the ref + * iscsi_cleanup_conn_work_fn took. + */ + iscsi_put_endpoint(ep); mutex_lock(&conn->ep_mutex); } } @@ -2322,6 +2326,12 @@ static void iscsi_cleanup_conn_work_fn(struct work_struct *work) return; } + /* + * Get a ref to the ep, so we don't release its ID until after + * userspace is done referencing it in iscsi_if_disconnect_bound_ep. + */ + if (conn->ep) + get_device(&conn->ep->dev); iscsi_ep_disconnect(conn, false); if (system_state != SYSTEM_RUNNING) { From patchwork Fri Apr 8 00:13:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 559405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E56DDC433F5 for ; Fri, 8 Apr 2022 00:14:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232748AbiDHAQB (ORCPT ); Thu, 7 Apr 2022 20:16:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232684AbiDHAPo (ORCPT ); Thu, 7 Apr 2022 20:15:44 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFA28108BC0 for ; Thu, 7 Apr 2022 17:13:42 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237JfC2N006378; Fri, 8 Apr 2022 00:13:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=JrvoyWrh80SL1vhsbW87cv8RLeiaK7QZCpEjyGWQQX0=; b=koGMi79QjmOiRAvSnNN4LxvLH9iGdbZxgs3bT/oclvoTRHNEp2PZ61Z2LXJUQjJxWcr6 KzgOcaPxnwsyVuPDN/eaBwM7cVeNzQvl5XODZgMaltczuXDbj1hkilzR+R7NfC9YzNPl GECA+pKs1iuCmZczjAiVnFV6xFoYNVYjQFWiKFIcrc3jQr4lLQEkRXreFS1nupuTqE+8 A/S7cKGHHhkSESUHSKT3vTgGbHHkfLcDeRS3wY0gwQX4UlnLeY4cGZejQsjltGJ7A9on yFD3+lF21VnoxiFBZBLGD8WUwkRTysiPyx8Z0V9nDglzsDvRsmjFbnccAK+TKq6QiKJr OQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6d31nh89-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:28 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 237NFHE4013838; Fri, 8 Apr 2022 00:13:28 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3f97tu11q5-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A/zLUIUK0hwS4cYAtx69CtfTCPCx6DRqM1yGacS+jIlr3yyB1iPd8Oe5+8etWqVa/0vFehS6FJjb8j18m7HvxEZmgqsVU4mQ+pFPqFHwvT4f5TqHEk1ZJ+D6AMq8Rt2XDHpEQmzi3VqjbDaMlzFi6av2MW3+qzQ8vswutNX6G6mfuvgq/wgCdwlc4BXwekhj9qhzlTTpksDCNIuy6JbJaRaPmcgm9kAFR8oRSCSrIaP49BHRn0sfHBHxPDUDohWkCzGb0J5Rfbff2mQ+24y80L60UJK9no/bzedBBJXQyu6QB3NX6/cLkSDkACMPSmMaDReeohumWuIxzufxVwI84g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JrvoyWrh80SL1vhsbW87cv8RLeiaK7QZCpEjyGWQQX0=; b=nlz70Nms0oSYETDiZAArikYaQq6pM+8tMkNz4O994OXhN0xfs/y4c/ZObnRXpFYdDJ4FysthyeBFeUf3QZbsO12JFPMRCaj4y255pi7nZDVclRjrju3RTRVS7HeBzl3OPNNQBIzIiPifE9lXUuCHYKs+T+v0KgyOjXp7i19TEhl8U1ie0TltTFm87KQxirF/dBGBaCrKbPtWL7K4o5gObcG8woCxl3Q+UvxG/98GwFdmc95uSsavhbwYHk3D+9hUXg8gsSaw+PrSoW58u833/iWoMexMqfkfzQptv7sJXTFXguVjJ85AUgInGXmP01xlhqhW71+cj5GBuHpW7IVM0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JrvoyWrh80SL1vhsbW87cv8RLeiaK7QZCpEjyGWQQX0=; b=gGi+V7APRXgZ2Nspk1ZAh1mTcYv0C7K2wdpWwrdICWlqP5alL+4XlY3aU4nMaYkXLdZUtqsbvNq+8Ldn7us+2pjervXmbHF5ti2qimx5a/XRzeQJUG/RjXmWsomvNZl9H0aUyLQZp6tp+nCve2up3x3RdyLQGG8SfqpRfGxQP1I= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB5550.namprd10.prod.outlook.com (2603:10b6:a03:3d3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 00:13:25 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586%2]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 00:13:25 +0000 From: Mike Christie To: skashyap@marvell.com, lduncan@suse.com, cleech@redhat.com, njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 05/10] scsi: iscsi: Fix conn cleanup and stop race during iscsid restart Date: Thu, 7 Apr 2022 19:13:09 -0500 Message-Id: <20220408001314.5014-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408001314.5014-1-michael.christie@oracle.com> References: <20220408001314.5014-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4919646a-e390-4783-a88b-08da18f49945 X-MS-TrafficTypeDiagnostic: SJ0PR10MB5550:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VbeN6fWusIwSJVdauJHb7MeavW3iK886OKptK0YUzobDbWymxzS3x22wkYBqdIFyT1gyXlTWqVte1DvxV1VaaKm5dgnC3199/guJWYac/500dpRs6LwEP6ImNMt7oreVwHo67tRELgQbi6szyFK2iVIHarwJeFp1sHri354qEd8eG0GmGfqExyxd+rfiP/Pxjmvj4ybO4edlfSP3O/HTCXMSes6mJmFvNQe4mI6vTZEU7WySd6S1NsRkM2ZDvTt+wXZ8aL7/E/LiHKbtmBi9gS+ZiB6yiHN9hmdwqfmSGCNGRoUgkW2VDVGDTUZU7Vgf3aCtlVCDkqgH3woi3XQ8fPMYGglhZ6x+oH0wATeRqPsOR3rS8irIZG6cZDNfwMtDjs5CBcLCraloL609Qt5tInj0WL9umkedQaqwkAZqK5ck/lUFSVsQpp8ssHFfprXzioyVTrV8Bnjm+3ACgBBOcrGtLgGgcfRyPuY7Oe7skxBWaC1Jjj3TXmvsWR/stUnLz3q14Ni5Ja9yne+I08d/bmuyn5Dh+jKBnO6d3QfI/BzpnZ+MVf/kt3xCt9TPoMZ2TorJjsQdtQ0PGyotw1PSKUjcoQknsPsd/x3JRBLCUQu/pO3pwvBMz4c7MCP9WUU5glFfFL7ByhXfRzMr5fZsKoZpOL39z9aXr1oSwPETeq+Q7zLj3hat/5SaX9JSGxG4CNhy4Pe7Xp3xATFCVFJAbQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(8936002)(186003)(83380400001)(6486002)(86362001)(316002)(2616005)(6512007)(5660300002)(6666004)(107886003)(36756003)(38350700002)(508600001)(38100700002)(4326008)(52116002)(66556008)(2906002)(66946007)(26005)(66476007)(1076003)(8676002)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QJQdargWKHkfmYXLaEKH+A+WZwgfyH+STEU2d6qojtOLnK83etXqfCKhCN0csVtrQg01uZhXw6K/5oTIvzWlJqcAIP6SH/FxnU97ZAWzQuMdPWrHNgu5hzIIu2Ww+rhDd52aOrRl5rq1YuH27aq2+YDKsvCiWUEXDN0zcXlOSN6iahVMoXJjAP+laatUkBfE3oSXeijoB0NgaYdsOO6SYcQ2ecuzfojJchfP0ViQ9pSuh7m6n9Rnh4tGe5LHQDqG9hbL3yG6LD6LyRC0wvK79+g+8R9KrKeVk7FOoxv5I292Gvpf0S+9TK9BvE2i5rjD5dEVhjG1jPI88bOgNc4jn01PXiTNeHIBb8No628aBbX8kcaaUgdrjQ28tIU2j98j20iI9s5fVqn1+uE4rdTNRs+1sEVCCHcbtYZtNojD/DueSRpQgr4prLmyMkEII2CGYfuSjoQ+7Ao2tKRN7HDlI5hw4Pl0K4uslGcVhzxRx4/vwC43sZctJp3W/IgEj5RDAEAwaD0foaAh42LR6vZihmDVk5iERAiyUW4PO+v3PgT8NNVbRiYEoq5TN8PpphCiLGEVXS2c+TjFOj7amZqZ8k/II/Rv7pYe8hH/YkOFQVtv2A9BqaJ35evdP7h+xG8lYdE65nwvTmsb8hkCYF6j0V8kDwfqVHUMiDQenxZVYn8cDaIeplyp31taWvIUBMCcGPUjaIIOP6i3uxrOy3FuW9MqWTrN5l2QVTPxQLZuP6G+vPgr4AnE1oodS/qGNOIXo9oaP97iF50v+kjwtyLEsAsGaouQlRjWtmal2OX3M+vfY/N6dgU+gkB9BNmvhPX7FKhwJtjXYbkg3itbv0+iAVW5ZcBgx+XBq0ZabqD/LmwKviChomW386QtvHrsiohe9d3JYQq6XLf6+Aef9Aeqv9ALTT0a0zQOeOifLyfGaVMtjV/FRNqus15edBvXe7L8m6EuiiDC3MzaT1P9OZvnmqpccKNqWsOojDnKN1bAbxr2ejQMcxYWao1qHpnbXfxDnk1fcEbAuxJODzFGoNp/O1RnuWinuw9b5eLg0JOhhO3yPhZn/dSeSavq8qPAF68fhGV+BENOMqLSObZZ4UFIcg3XqrGmsgFpiFjSViC36UWIiKty9TiNfU6E3corqr+tWU6f5V1DFybR2OH40ZoTmAyidtIsh9kAKo/duKk6XMgQ7jLe6WZhlPIYEbP1BwTa+f9FKJftsa/K4ewIBKS0uZlVwgwVYSIPq/LAlXu+N0obvt/AhzDcrJ9jk3NiaPKpuFuOVHPJXmjktQHDk2xiiOwaQiAkNvocilUwxMkPweaLddNysSH6HRBG3aBVq3fmoSQCBpPDpY1I3M0LZ6/oreBWMdpYib958cbAq+wiVCkZ3AQ+CqOzL8hj4f/5V3m/oa8avj+FlnZ6rfsq1uGhGAP+JWv+AFAD8X/kd2iViWrwImu8NfTL2dVuMkg+ghCRhrPTMLV81o8y/6P6j/PHIOiJijcMd6SCYaV0S/VuTAbGLbb5tuTh81X23EKH/B+6U8sOguACWEUsXwZ6l6EoKXFwVBz1Twh+G7C+HIQem8Ce2QKjc0cBsIjoFnCh9ljvI933LpZ/Panbg96HTxdKTfLDCvW3kVaSAKPwnSsF0caVAV7t4JQq1cJ8ukvIwY+UDUiVexQoeygwK+znTOQ74lkXrTi1FJtdqJgyhmg23gib/lE08fauaDlTw3IWArNzAghT5zGkWA7aGFc3taeFhAXtee7Hr1PZQbFJ38Cmp+M= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4919646a-e390-4783-a88b-08da18f49945 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 00:13:25.0631 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mOUOnnWatgjBt4v0phR9W0RaLpcwzkqA0vFEzv/mkJfAsDKufvTAmo2qmj2Sa4fKtjvU4NRZjTPcKrrnzmV7I06ICSdYxzzsPO4MzDAnyI0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5550 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-07_01:2022-04-07, 2022-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070064 X-Proofpoint-GUID: n3uG5Giw-qmXBkzFTspq6B0Zcjp-inGP X-Proofpoint-ORIG-GUID: n3uG5Giw-qmXBkzFTspq6B0Zcjp-inGP Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If iscsid is doing a stop_conn at the same time the kernel is starting error recovery we can hit a race that allows the cleanup work to run on a valid connection. In the race, iscsi_if_stop_conn sees the cleanup bit set, but it calls flush_work on the clean_work before iscsi_conn_error_event has queued it. The flush then returns before the queueing and so the cleanup_work can run later and disconnect/stop a conn while it's in a connected state. The patch: Commit 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") added the late stop_conn call bug originally, and the patch: Commit 23d6fefbb3f6 ("scsi: iscsi: Fix in-kernel conn failure handling") attempted to fix it but only fixed the normal EH case and left the above race for the iscsid restart case. For the normal EH case we don't hit the race because we only signal userspace to start recovery after we have done the queueing, so the flush will always catch the queued work or see it completed. For iscsid restart cases like boot, we can hit the race because iscsid will call down to the kernel before the kernel has signaled any error, so both code paths can be running at the same time. This adds a lock around the setting of the cleanup bit and queueing so they happen together. Fixes: 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") Signed-off-by: Mike Christie --- drivers/scsi/scsi_transport_iscsi.c | 17 +++++++++++++++++ include/scsi/scsi_transport_iscsi.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index f200da049f3b..63a4f0c022fd 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -2240,9 +2240,12 @@ static void iscsi_if_disconnect_bound_ep(struct iscsi_cls_conn *conn, bool is_active) { /* Check if this was a conn error and the kernel took ownership */ + spin_lock_irq(&conn->lock); if (!test_bit(ISCSI_CLS_CONN_BIT_CLEANUP, &conn->flags)) { + spin_unlock_irq(&conn->lock); iscsi_ep_disconnect(conn, is_active); } else { + spin_unlock_irq(&conn->lock); ISCSI_DBG_TRANS_CONN(conn, "flush kernel conn cleanup.\n"); mutex_unlock(&conn->ep_mutex); @@ -2289,9 +2292,12 @@ static int iscsi_if_stop_conn(struct iscsi_transport *transport, /* * Figure out if it was the kernel or userspace initiating this. */ + spin_lock_irq(&conn->lock); if (!test_and_set_bit(ISCSI_CLS_CONN_BIT_CLEANUP, &conn->flags)) { + spin_unlock_irq(&conn->lock); iscsi_stop_conn(conn, flag); } else { + spin_unlock_irq(&conn->lock); ISCSI_DBG_TRANS_CONN(conn, "flush kernel conn cleanup.\n"); flush_work(&conn->cleanup_work); @@ -2300,7 +2306,9 @@ static int iscsi_if_stop_conn(struct iscsi_transport *transport, * Only clear for recovery to avoid extra cleanup runs during * termination. */ + spin_lock_irq(&conn->lock); clear_bit(ISCSI_CLS_CONN_BIT_CLEANUP, &conn->flags); + spin_unlock_irq(&conn->lock); } ISCSI_DBG_TRANS_CONN(conn, "iscsi if conn stop done.\n"); return 0; @@ -2321,7 +2329,9 @@ static void iscsi_cleanup_conn_work_fn(struct work_struct *work) */ if (conn->state != ISCSI_CONN_BOUND && conn->state != ISCSI_CONN_UP) { ISCSI_DBG_TRANS_CONN(conn, "Got error while conn is already failed. Ignoring.\n"); + spin_lock_irq(&conn->lock); clear_bit(ISCSI_CLS_CONN_BIT_CLEANUP, &conn->flags); + spin_unlock_irq(&conn->lock); mutex_unlock(&conn->ep_mutex); return; } @@ -2376,6 +2386,7 @@ iscsi_alloc_conn(struct iscsi_cls_session *session, int dd_size, uint32_t cid) conn->dd_data = &conn[1]; mutex_init(&conn->ep_mutex); + spin_lock_init(&conn->lock); INIT_LIST_HEAD(&conn->conn_list); INIT_WORK(&conn->cleanup_work, iscsi_cleanup_conn_work_fn); conn->transport = transport; @@ -2578,9 +2589,12 @@ void iscsi_conn_error_event(struct iscsi_cls_conn *conn, enum iscsi_err error) struct iscsi_uevent *ev; struct iscsi_internal *priv; int len = nlmsg_total_size(sizeof(*ev)); + unsigned long flags; + spin_lock_irqsave(&conn->lock, flags); if (!test_and_set_bit(ISCSI_CLS_CONN_BIT_CLEANUP, &conn->flags)) queue_work(iscsi_conn_cleanup_workq, &conn->cleanup_work); + spin_unlock_irqrestore(&conn->lock, flags); priv = iscsi_if_transport_lookup(conn->transport); if (!priv) @@ -3723,11 +3737,14 @@ static int iscsi_if_transport_conn(struct iscsi_transport *transport, return -EINVAL; mutex_lock(&conn->ep_mutex); + spin_lock_irq(&conn->lock); if (test_bit(ISCSI_CLS_CONN_BIT_CLEANUP, &conn->flags)) { + spin_unlock_irq(&conn->lock); mutex_unlock(&conn->ep_mutex); ev->r.retcode = -ENOTCONN; return 0; } + spin_unlock_irq(&conn->lock); switch (nlh->nlmsg_type) { case ISCSI_UEVENT_BIND_CONN: diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index fdd486047404..9acb8422f680 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -211,6 +211,8 @@ struct iscsi_cls_conn { struct mutex ep_mutex; struct iscsi_endpoint *ep; + /* Used when accessing flags and queueing work. */ + spinlock_t lock; unsigned long flags; struct work_struct cleanup_work; From patchwork Fri Apr 8 00:13:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 559128 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB832C433EF for ; Fri, 8 Apr 2022 00:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232747AbiDHAP6 (ORCPT ); Thu, 7 Apr 2022 20:15:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232728AbiDHAPl (ORCPT ); Thu, 7 Apr 2022 20:15:41 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0906C129EB6 for ; Thu, 7 Apr 2022 17:13:35 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237KPqpT001019; Fri, 8 Apr 2022 00:13:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=34wBEfPdQzUxy7m/ionnlVKAJ0KYEGYR+8FG1SXvDwI=; b=DKMbbDvT8rx/6kxI2LCexOeiKSxvKPwtnNyPKsj9w5Gmw7wp1GsH6CWhQqm7K3H43DzF Tp+96RdwT+8ROqwg1Bbq1FCrFZ4Fda+IUJdboL9K3j9/9E+KDmBsTsCwLH9qbEKHB4tq bppzol7DcfxGlnu70ROwaHTaWvFNZ5LTwmctubaxjHhO2MctaZL4T+szOPk94nmK3JcZ PX45e+t742sMiLlEoJG0jnUfkZbL3uuJaOLsiAtYU1kKpQKHojgAhR9k/YnlgMTVqmZK M9sbTw2TThtK4bVjLvFgsfDCt38d8ZD50Ct0y9bTEiM7Vfk/NSsBtqWjxs/ZyRiPfz9i +Q== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6e3swbyu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:29 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 237NFHE5013838; Fri, 8 Apr 2022 00:13:28 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3f97tu11q5-7 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ppx9/vXCdGTa6BRg9hkrwun/CEGm6wsqQj2cgzP6tu/MHOwE1HKLDF8jHpKSM+athJbbKdjCIJXqzSfHFwFQwIzhRzXDmU1VuJskuFik5TloTrjovtwGkGfy+lqH/SDw+QSy4/WW+wRIqwGjKRZU13aSSfuZlWmsylqWb6YlF1FkHjT3UgYiR88pRu5R/1QIaWUyW9uXZmH+OydClSIwBv2FhMFsmPosxKLOpG16XsJ6gQFTDmPatIoqqOAbh+biimCCBkePO0esXh1eiCokfi2df7aUWCL+RIZZBazyfWBl9JIkvwQzcaFBlDkeI4cRI+lZaLC9YIY0+1YCljMM2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=34wBEfPdQzUxy7m/ionnlVKAJ0KYEGYR+8FG1SXvDwI=; b=BVrJH/1GIfrqSkgtfpmrKdOJmjK3ALnMNxhH9Ffpf7Kgxn/D+5oXqhQQhoHuO45/xExqG3ydtcZXRGdHJW9DgZJTB07qvIHoUsm8dHbbO2U2Gv+hwkiPCoEstYVex+V9O4Zv2xo3hrW7ZX7ildM76V3Kk/vkFPWR6MzvVJ7/fqoWs8+7aPU7yU69bd2yG7lX6mGzoHTKUr/OBpJ+ltetoiWN3OrsY8tKdUSk4pTR+s9yqq2wFotke3+TbC+Y8ub3TrhRX6xgdpW/Y3qe3fw8nn00nmfY2RASP8FMnz8BRYwc+EB/f4ZBa15KUrjCTu5dBZ5SwDtmMMgt34k06e9SsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=34wBEfPdQzUxy7m/ionnlVKAJ0KYEGYR+8FG1SXvDwI=; b=fM1eb/5ZhYZqsdXJYEMe6YS0n+4OOehCdq1OvEFpW5C7TQVaU7pD2/JUnVPMP/H4IHR2XeEp7lp8/NFKNvaFP9MVTk42FQcueOrPkDfg2JNve46a8sDZdX+HwXnYAR7fi6xJaMA0mEBEYIqsrjic6aarOrP5wwltZenAX7JHByI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB5550.namprd10.prod.outlook.com (2603:10b6:a03:3d3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 00:13:26 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586%2]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 00:13:26 +0000 From: Mike Christie To: skashyap@marvell.com, lduncan@suse.com, cleech@redhat.com, njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 06/10] scsi: iscsi: Fix unbound endpoint error handling Date: Thu, 7 Apr 2022 19:13:10 -0500 Message-Id: <20220408001314.5014-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408001314.5014-1-michael.christie@oracle.com> References: <20220408001314.5014-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: daafeca8-2751-42c3-b6af-08da18f49996 X-MS-TrafficTypeDiagnostic: SJ0PR10MB5550:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n0exNtxyF53PYXJ+D704hN7dswzbDELhBnJc+crbcSM03VbgrZMsmJFRT2qpWFS7QrHQciAZfsx1b/6p6mNf6PuFl/W99G4Q46ijrpNOKOz+5tkhsGPvgPdS709GYbmux2GHadfxL3j69j5rPdu4BjwCWDSfLyS6zbwtMiVKAFfIuyi3+ufRadv/wJAmB+F8cQMIWYI3wp+hfBlD1s0gPeMeIwp9wpJdi+c12x+jsR5OVbWJf29QNEbOBFGOl7qm5C3R7iBiUzohcyAtmvdcQ+ITSBz+TnsQHZdlrtqIERpXkARhz8PlkV+Rhi9Nl9Ptw9u9HtGmeAxxam8s0CvkKxUOHCk4MD/+hz3JwYsMkv+kWF/atukjpyOro3lcZvWfXUMkZahBdlSnz8UqujRdpUuFHdewLluYwX0pwCN+HfM8oAyvacYiZbBuKKn3a3fCdYP3RxNm+93YH07RQ/NicycKwuMZZm0icaA414YAV7RcHMx3VJlfAYsCCgi3lwVuzc8JA0vmL2S7qu62KH96ttd1gujwAmDlt9JIh2AUBgT1aRI2nH8ffm1c2l7IqNQWJC20gY07dGcXFZumbjSlyKgDAkNPjQqzR5sItfV+JJyqiVOKlu2GPTTeBnkz8+ESUDk0ZYOYqYQ+1coxwXVy/FJ9Z338ppfPz1GkWW2/eKtRiXSDA0OH0jt5dIXJGXBxo5OYnrvMAHgyYp5t5inQ8A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(8936002)(186003)(83380400001)(6486002)(86362001)(316002)(2616005)(6512007)(5660300002)(6666004)(107886003)(36756003)(38350700002)(508600001)(38100700002)(4326008)(52116002)(66556008)(2906002)(66946007)(26005)(66476007)(1076003)(8676002)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J+jHb9CMvoxSvJ0YCQNzBvq+5399YZbwXJxkOypFZ/1OJkd8eerIwyZF9NUsBtHHU2IytAtdSmu9aklHXtbrqcNpnCu86EVNeqny4nR4wgm80ANlHOOZgZj/Io1xQFEnLiL+pf5Jjgcrx9j5hvvd6QzOyMFTUX/6OBas15b0ZZzq5u+Q0E6Pmw88kJGaQ2B9d6Cfw2TOEDtA45dwDCA+ndcJe7DcPRSGVoGLEYpXfA053n4yVMYkyGx3DatG15qFlOLB6PowI+h99wSpwgLXBBsRBoa+Lj/SBUiyN1uAbIocSQJK7J6LxO9c5td0FJFvDJzpuFGNQonsZGpt7o8E3/QO8JaAbsihGXW3zJdZcNJ1Inz2+NTskS9kY1PqcQDBW5h6Cqb/KDXU/5rIdKBgpK3EAu6q8hOIRhRKup0lnjDgx+BvlPkxtEuIR1o25YPOjCXnO8DEdPZwv1f7DYi9Wn+2q9FGYZhMBDuxOfOMQUdLGxj1gQJ2qowiEv0vtcAiSs/mhw4eAxLu+z2/zqeO7TEUtdJlzPTX8P3vjKMAQd+QjpFkBpb0gZCwNwcIFAjDYiEC/CJdYxkXkyUVfp35tfia6084WP1iucf5mwdYN/6dAWTnBoGXi96dyCvly3J2CT9Zz4Y6OWvXXO0LvRIer+nqq180ewwV+tnC/JAvE3GPdfeoUKY1apNb6i8eSn+FUn8du6IP1CEd5hI7yexbLwkkdqfEk8GBk+8eTTgdtCkSbe9/Gj1H4M86niw48MbpkcXaab3Hu8HYN4jkbmDdM4Yb0NDOt62ZMlqhViDxUyBcah76ItfP+pjXuvrLp5JFbfJvkwSpf4xzpsoo6HbnRgcJRggVaRwlwGcikJH9tl8m4eOpVTB2AV6/QD/ZCtuRPp7j/6G6djmPGHNMOasQxKABh5IYJRa+A5vD921GUt2V45vf28hs/bL20QH0NsPnU2Jd+kRmRIH3BsRCIjuzH/F+qjp5NUk+Ocuk+iXMLkAtT4Z28jKx5DBZK/N95f+p960Vir9fxxH5E1xrrvOCVsO7X3zwv0sAKR6LG4yrv/fkKiJv2yDRyBPZIrOvvHm3cb1RFRehx4IE32t06SLzxitjfcFAys81CRTE5Mu8f2du5Mklt+8j4U8yjKMIlYPXJpm96rlCkfi4pdzWCz2PLqXu6LSVJlV7Esy3Y789EBu674myUBfeu2MksSgiK/8Ip0vi1T27pWE51ABsDnpFdejZbUnDwRSfcvFlniKT56jX0bruKMSJCK+BGyAgcY1Nz+B828s8GSP+B+iLTPbUBWBc7SVwNFBBVUPLsuQGlBrLs1fCB9xecwrPMMDdp+lkoSxX/ubo0zhHgzWDR+3VQeB71Q5xM3wo1KNDcma5sMQBA0eYR/OlZ+R2JFZX7cgskoKFdCEhDJeoosr4VrncLc74s0PCmHjY3KEc6Kj0X5vLhRZxyVDECJR/ZJDxjxv7g6X0t9/uaT12J8sGUlUdA8I8Ne7ui622vaqeA324Jhnpa7okz0Ds+lp+ELJlW9jEhvozdZPBJDUlwOfCk6cFdg/wl44csNxZ++ACDk0cKfJ6OCV357T6QErsnzP7GGQhQTHErgdwM9/XnCXe1/lFO7V3Tb7xEReY7ClLtXVpccVsNRnhO2YpXpCALmsLByYYZHFYGHumdqkfRF8fhE1ae1biFzlFHEPELnLk9VL7zcNUoWbYnXjNHtLYdmwAcSk8IKYCozDYpSz87OOahtxM59GzQfJ5GkAGUVKkTdlK6RE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: daafeca8-2751-42c3-b6af-08da18f49996 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 00:13:25.5943 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2CqGZ8XNd7+250FbyFA1yV2nKib7VUKA9g1c1slzUVN7qWZsdAz6Izsdh48VIBgz8MEbBsdokwQGj2k3fctLHCZC9PeHhjkBy8/KbFOM+Bo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5550 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-07_01:2022-04-07, 2022-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070064 X-Proofpoint-ORIG-GUID: Annd0k9x_pLJNjjNxOAA6X2GMp5hEyWH X-Proofpoint-GUID: Annd0k9x_pLJNjjNxOAA6X2GMp5hEyWH Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If a driver raises a connection error before the connection is bound, we can leave a cleanup_work queued that can later run and disconnect/stop a connection that is logged in. The problem is that drivers can call iscsi_conn_error_event for endpoints that are connected but not yet bound when something like the network port they are using is brought down. iscsi_cleanup_conn_work_fn will check for this and exit early, but if the cleanup_work is stuck behind other works, it might not get run until after userspace has done ep_disconnect. Because the endpoint is not yet bound there was no way for ep_disconnect to flush the work. The bug of leaving stop_conns queued was added in: Commit 23d6fefbb3f6 ("scsi: iscsi: Fix in-kernel conn failure handling") and: Commit 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") was supposed to fix it, but left this case. This patch moves the conn state check to before we even queue the work so we can avoid queueing. Fixes: 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") Signed-off-by: Mike Christie --- drivers/scsi/scsi_transport_iscsi.c | 65 ++++++++++++++++------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 63a4f0c022fd..2c0dd64159b0 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -2201,10 +2201,10 @@ static void iscsi_stop_conn(struct iscsi_cls_conn *conn, int flag) switch (flag) { case STOP_CONN_RECOVER: - conn->state = ISCSI_CONN_FAILED; + WRITE_ONCE(conn->state, ISCSI_CONN_FAILED); break; case STOP_CONN_TERM: - conn->state = ISCSI_CONN_DOWN; + WRITE_ONCE(conn->state, ISCSI_CONN_DOWN); break; default: iscsi_cls_conn_printk(KERN_ERR, conn, "invalid stop flag %d\n", @@ -2222,7 +2222,7 @@ static void iscsi_ep_disconnect(struct iscsi_cls_conn *conn, bool is_active) struct iscsi_endpoint *ep; ISCSI_DBG_TRANS_CONN(conn, "disconnect ep.\n"); - conn->state = ISCSI_CONN_FAILED; + WRITE_ONCE(conn->state, ISCSI_CONN_FAILED); if (!conn->ep || !session->transport->ep_disconnect) return; @@ -2321,21 +2321,6 @@ static void iscsi_cleanup_conn_work_fn(struct work_struct *work) struct iscsi_cls_session *session = iscsi_conn_to_session(conn); mutex_lock(&conn->ep_mutex); - /* - * If we are not at least bound there is nothing for us to do. Userspace - * will do a ep_disconnect call if offload is used, but will not be - * doing a stop since there is nothing to clean up, so we have to clear - * the cleanup bit here. - */ - if (conn->state != ISCSI_CONN_BOUND && conn->state != ISCSI_CONN_UP) { - ISCSI_DBG_TRANS_CONN(conn, "Got error while conn is already failed. Ignoring.\n"); - spin_lock_irq(&conn->lock); - clear_bit(ISCSI_CLS_CONN_BIT_CLEANUP, &conn->flags); - spin_unlock_irq(&conn->lock); - mutex_unlock(&conn->ep_mutex); - return; - } - /* * Get a ref to the ep, so we don't release its ID until after * userspace is done referencing it in iscsi_if_disconnect_bound_ep. @@ -2391,7 +2376,7 @@ iscsi_alloc_conn(struct iscsi_cls_session *session, int dd_size, uint32_t cid) INIT_WORK(&conn->cleanup_work, iscsi_cleanup_conn_work_fn); conn->transport = transport; conn->cid = cid; - conn->state = ISCSI_CONN_DOWN; + WRITE_ONCE(conn->state, ISCSI_CONN_DOWN); /* this is released in the dev's release function */ if (!get_device(&session->dev)) @@ -2590,10 +2575,30 @@ void iscsi_conn_error_event(struct iscsi_cls_conn *conn, enum iscsi_err error) struct iscsi_internal *priv; int len = nlmsg_total_size(sizeof(*ev)); unsigned long flags; + int state; spin_lock_irqsave(&conn->lock, flags); - if (!test_and_set_bit(ISCSI_CLS_CONN_BIT_CLEANUP, &conn->flags)) - queue_work(iscsi_conn_cleanup_workq, &conn->cleanup_work); + /* + * Userspace will only do a stop call if we are at least bound. And, we + * only need to do the in kernel cleanup if in the UP state so cmds can + * be released to upper layers. If in other states just wait for + * userspace to avoid races that can leave the cleanup_work queued. + */ + state = READ_ONCE(conn->state); + switch (state) { + case ISCSI_CONN_BOUND: + case ISCSI_CONN_UP: + if (!test_and_set_bit(ISCSI_CLS_CONN_BIT_CLEANUP, + &conn->flags)) { + queue_work(iscsi_conn_cleanup_workq, + &conn->cleanup_work); + } + break; + default: + ISCSI_DBG_TRANS_CONN(conn, "Got conn error in state %d\n", + state); + break; + } spin_unlock_irqrestore(&conn->lock, flags); priv = iscsi_if_transport_lookup(conn->transport); @@ -2944,7 +2949,7 @@ iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev) char *data = (char*)ev + sizeof(*ev); struct iscsi_cls_conn *conn; struct iscsi_cls_session *session; - int err = 0, value = 0; + int err = 0, value = 0, state; if (ev->u.set_param.len > PAGE_SIZE) return -EINVAL; @@ -2961,8 +2966,8 @@ iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev) session->recovery_tmo = value; break; default: - if ((conn->state == ISCSI_CONN_BOUND) || - (conn->state == ISCSI_CONN_UP)) { + state = READ_ONCE(conn->state); + if (state == ISCSI_CONN_BOUND || state == ISCSI_CONN_UP) { err = transport->set_param(conn, ev->u.set_param.param, data, ev->u.set_param.len); } else { @@ -3758,7 +3763,7 @@ static int iscsi_if_transport_conn(struct iscsi_transport *transport, ev->u.b_conn.transport_eph, ev->u.b_conn.is_leading); if (!ev->r.retcode) - conn->state = ISCSI_CONN_BOUND; + WRITE_ONCE(conn->state, ISCSI_CONN_BOUND); if (ev->r.retcode || !transport->ep_connect) break; @@ -3777,7 +3782,8 @@ static int iscsi_if_transport_conn(struct iscsi_transport *transport, case ISCSI_UEVENT_START_CONN: ev->r.retcode = transport->start_conn(conn); if (!ev->r.retcode) - conn->state = ISCSI_CONN_UP; + WRITE_ONCE(conn->state, ISCSI_CONN_UP); + break; case ISCSI_UEVENT_SEND_PDU: pdu_len = nlh->nlmsg_len - sizeof(*nlh) - sizeof(*ev); @@ -4084,10 +4090,11 @@ static ssize_t show_conn_state(struct device *dev, { struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev->parent); const char *state = "unknown"; + int conn_state = READ_ONCE(conn->state); - if (conn->state >= 0 && - conn->state < ARRAY_SIZE(connection_state_names)) - state = connection_state_names[conn->state]; + if (conn_state >= 0 && + conn_state < ARRAY_SIZE(connection_state_names)) + state = connection_state_names[conn_state]; return sysfs_emit(buf, "%s\n", state); } From patchwork Fri Apr 8 00:13:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 559131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EEC3C433F5 for ; Fri, 8 Apr 2022 00:13:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232754AbiDHAPr (ORCPT ); Thu, 7 Apr 2022 20:15:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232732AbiDHAPl (ORCPT ); Thu, 7 Apr 2022 20:15:41 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43A6A12A8FC for ; Thu, 7 Apr 2022 17:13:36 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237NAa4k014737; Fri, 8 Apr 2022 00:13:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=dSVVvnRo7jDyQF1UEfJ9nfGfuTuhMtgmUInw4qCJyjw=; b=JUlC2fA/joIi01Xh8DXkkYu9smicQeYBZbvkInHKP0jHChYwilrsOCO0AFfUCnsX+Zjy bmmqQ4hmzFXb6pFaO8Vdcky3MOzoQNYXUTapjdYRtgB2KmwDZZ86RMsCTiy4OoQDKcy1 kIacqUrPn5B4BdhnnPHlWXv1Zlqd+8AjJ98/4IUlxJY8Xv3SG33V67nWOenu0IhuvwCJ wfJTLr7kNBvwvIXr8llKAdoX1qnEVVCXEM7oIsPSZNo+YPi60FOG4ty40G8Csk4gkcit rPVT9iKQNLPsGpWRCY8Rp35B1cfV4mRl0JaFPRwDOqTbAdh5dcedaSH9onHp7ILCFbhN CQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6ec9w456-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:29 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 237NFHE6013838; Fri, 8 Apr 2022 00:13:29 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3f97tu11q5-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cHCK5Y+7WCxk33XozxTrJGik5xxSR1L1TB7xU0PpXRxlJv2nfGEEM9+uXBuxOlZMYBRuE5ss9JNtDsLs7Tl0kd5aLyIfQwRd/8mIOYHUqbZoC2gLrGlbOsoeqUtWdvk9eLnTETFMF+cFq0UsGYvQYOowB7FuVA9k5CfquJyRWktKubIf5C7EPwmf2NqvL+hPuRbBJYqg4Zun19qxjK5zHwD6qkBoK0sAFGEWGLmeDK9vza/vJ+E7bem8Nep3cmcWp9IrCYpRZoZqRESN6tVuWT0Mj9t2hgEXBWxtVoIC2x4II/w9UwkeFCXfHmoHGGdfFDFXbJA7xh7TSXkphT+7mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dSVVvnRo7jDyQF1UEfJ9nfGfuTuhMtgmUInw4qCJyjw=; b=TdSugBkI7XbeVRLujt9OxZcfQl92hkw7CYD36m+upmLYla2HF92QbaDfcUx7uCvqxP+0s82hPaQhgZP6uLvS8fJQ0vQnLY16T1j+ywOSAEHSPBQCPqPrz/YfnDnblPenapG2AMKukl66WwPS1DGj67VDEkXCVT89f9Yzi7CdWUsH9BExndT1Kkbcm7gQepIoai03io+vLQVYqJIDTkfwc4w75TLuvBbWw5Mcz5SR9RQxXDvjkqSaYnTtpafzaP+bsX07wEBwAkIuGDPZCm/kD/YadBChmBF953CjFUHehhm+aWRyKn+UEePFh5k+7LdwHCn3e2a30YS0Jf3b6qGKDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dSVVvnRo7jDyQF1UEfJ9nfGfuTuhMtgmUInw4qCJyjw=; b=W9qSdMLiWRI4GsYt+gMP8mtByn8h+9UnBjgeQ/cOTWv3jngN4y6hLTDX5MwhBm/wVPNWi5ytyQrGgrUW9YweD32AnoPBhgw1+v8tQ6SCRKckz6ypNwHAFikNc9Hx6nNq/cJ7h5m0dlwBcnFu0oj/X5NhAEcIBy55hZYzwSx6FDw= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB5550.namprd10.prod.outlook.com (2603:10b6:a03:3d3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 00:13:26 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586%2]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 00:13:26 +0000 From: Mike Christie To: skashyap@marvell.com, lduncan@suse.com, cleech@redhat.com, njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 07/10] scsi: iscsi: Merge suspend fields Date: Thu, 7 Apr 2022 19:13:11 -0500 Message-Id: <20220408001314.5014-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408001314.5014-1-michael.christie@oracle.com> References: <20220408001314.5014-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a01781e8-7e13-40e6-c4d9-08da18f499e7 X-MS-TrafficTypeDiagnostic: SJ0PR10MB5550:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LrEGPKG2xVftfG9mD4RCyno8wp/e/kbl8KNyQ28bctW/JU5m+wEresCfe6tlYEV9FfWu84sYs0lxbvn9p0kStzM0StG9lGd5Z8qXUQEK1Lsh3MOSxIa7bDsn4u8NY2vro/Y4oa9O82BFqsRHm3kLhzIaIbwTeJVKdyt83cpUbwrO1yvWwi3vw5Wkt5mfkBXYXkUdVmGy2OY+YYsGiBmZMJPLTIgQXWlyEVunEeLaawfZ7JcTF4O/MkfZ8vyPNuvFO5qxXVTRhK5EjCgfZwmfs5dsXgOFMDf1LCf/KhF3X8ewDzghn23Dm4jl5ErxN4lzxFW5RrdbWVlSlw8zkUBsPY+4dX3Bpv6hrD353+Kz8Qw0ErUMKwJuTiwSm9Ir+l1ukG0falENpd/dT4g0Td7pJ2XzA37hc9GBRpoZSB5fLi/VU5vZJxK3kGoD4Nj75ttF3rMhSZA0wSpP/7pBK6cqfys/ocUu4kdYhBBUBn7wdWquYe9gRimhgPSDOJGOHqP8BT+bnP5iyb+GZaaHhx8iCjb2CkuTBAOR66zGNvLuPCHGVAJLlq28P1u3cDpIjO9/glfbhWL3ZxgYSqVLa/vRmSoWHXEXflMgAIth0mdHpDBxpTdmvLiawcnbZGyQiegsW/KHKi8rYbxsLF7OtskXsC5a1h0y+3xp7rq2w8FVXS+O1jU/brOfpI9D0Mlu4MswrqXE2xHSOX2bXRSGO/Mcrg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(8936002)(186003)(83380400001)(6486002)(86362001)(316002)(2616005)(6512007)(5660300002)(6666004)(107886003)(36756003)(38350700002)(508600001)(38100700002)(4326008)(52116002)(66556008)(2906002)(66946007)(26005)(15650500001)(66476007)(1076003)(8676002)(6506007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gAVDgPGDsDoNPhraBAyKnQDS9Mllkn2y/h68JUlGUbqkYFwln2k3jYPlLfdJcGmfJaXI8HSjg6laxQy6BFO7PrdkmXjtd9C0IEv9+5dVP4d5oFVY/gTtGxwz2o0Fu0cWzTPKNVjvXas/xTcrQhRLV05pt4Q0vSljjyQ0xtil14gtZm24O+cTisv3MP6CSWGclrqQoesxoIqc3xIRH/z1/76dTNFDG2wXZXsd019llV91OWx1CImgWigQhmBa86ZTT4TVcGVgnRXi8qjlqe/Q1Kbv7pJBFlLV+mtOysSOvb2/T8rQiLldUS8dflFGS/A9SkW4n3lQ6ITYiQQtgBWInA94neeXrIkOFiK5Bs4xEdhOQ+R8oGuTNaP5DF9oWyO3HfngrKdBNvew5wPynehj95PkcV9uBXObSrQMrsXbl6mOFUstKr8lFUhaZ2OL3r0jQprgStQLMQsY1ieQGUyKH3QKXNi2ZzgGJMwxVFuMBUnHnabyUQzN07YH4owrDS4JEJOjvcy2wGi6aVsGmDboZu5diEmrEYncgOMe2WvafJwmfWgDQQ4cFic8r5PAYT9q50vMPwKDeXG88WK+ccK4FVhrAI8nOQePOJPjJ3uAtduwb2kS7zu8qKxvl2aMiLQF3SJfe2cctIyyMkVm0EspGyEtPEBGU2V8Ow5BGzkuQ3+E/5Fp2Yt9DLsshSTCC/obsEm4bIS1AcGhzVtq3ZiJuKSFI0zjGgvw3iydQCyf18gbszfuq0X1iKpxuqj7v05wEDJaAtU7Ch1HXOwpFvufqhk4iKHd0cbkhvuw/gg3AN8mhpEjlfkXqy0357sFufS0ybQqYPeDWwdr75lO/kqEJbWVAzrDysGWztCrrEI58mSprQ50L20UmkXGEZz9lUcNxt5TFPNtJ1OfOmA2dkK2Mqaa4OkDvWfDswu+ixsxlZVkklFwZ6n7bt5Wchtx05tuhpApofjiz7lJhWPL5pxbx4ULMqcHMQvFlpexsOSyfCSqYpOP6uSD9VW49HmA1gTlIO/y4pdGmI8JxrziaSscjPYG24YNMUS25LoMOgmKEF8+6Ty/0/XW8nuHYBpE2yiSqmoXwTLyBFcm47x2UUb11U+Ur5TLZs6WD/rymGghM2A1fIfYFMO2RXBLpFSKCFKeJPUe1nDx5cP5B1HGCvFSEUJ1yujmHv8CUpJcM3QibWKf7Qs3JwlHTOt9SejTDOFAGsnOyvA1CZXWaa4KFqsWwaSX3yPObpm8MLBhJ0tvgmKiy3ClLRyO3j1Le73PYJdxWvz9gds27RvSiunqj3mvGQBJHZznFfjFs4obtERxe66oDWeIKSHCOEzg2veOlUXL9KP1UWVN0YsdGaAJLeLS9iM0P4ltgnqtrmSuai19i53T05y1qGG6ZVTMV6RLy8PEB+K10D/x9VYYNYECXDujZZcAUrKIbmf32BApRXBzSLNh3ejiw1oZuL3jut/GKX+J1y1xOHkeowtcr1gRIDFIK0AuK9yNYuLpBj9Or6pjENwZb4rL+etHX1Z7iYgEweTwCRlYGY426G/mwvLLKrrrNNjrOex+A4q//W604MUvcMgBvIXF91s7XEcUg5PMEdqgNJqM3i7haKrl8D8ueR+OPIMKMjp1WqtTISpknB2EokTMRZTvPd1rMGYHllCr90MmRTQ/TC7Mya3L/+7nATvK+iB19sdn9RsOyKYTKvdw9SVfh/aqBNdJ08cznyxwEbNpfNAMTel19pXfJoZtCb/eM0+hdsegAqx0i9W8SYNtNIk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a01781e8-7e13-40e6-c4d9-08da18f499e7 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 00:13:26.0942 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: igcJHrK8IxlQrceYL3VBLbUegZXX8TgsxqJYDQv4bi9PUvUpZ5+wZ7BbD63KykY7582cs5peD/zlssTBYXtuIgl3TyuuTNlwHjnc3YGTJv8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5550 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-07_01:2022-04-07, 2022-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 bulkscore=0 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070064 X-Proofpoint-GUID: oa5RcJ9XDa0IqzAZa-wrGm-HmjghsiL5 X-Proofpoint-ORIG-GUID: oa5RcJ9XDa0IqzAZa-wrGm-HmjghsiL5 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Move the tx and rx suspend fields into one flags field. Reviewed-by: Lee Duncan Signed-off-by: Mike Christie Reviewed-by: Chris Leech --- drivers/scsi/bnx2i/bnx2i_hwi.c | 2 +- drivers/scsi/bnx2i/bnx2i_iscsi.c | 2 +- drivers/scsi/cxgbi/libcxgbi.c | 6 +++--- drivers/scsi/libiscsi.c | 20 ++++++++++---------- drivers/scsi/libiscsi_tcp.c | 2 +- include/scsi/libiscsi.h | 9 +++++---- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 5521469ce678..e16327a4b4c9 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c @@ -1977,7 +1977,7 @@ static int bnx2i_process_new_cqes(struct bnx2i_conn *bnx2i_conn) if (nopin->cq_req_sn != qp->cqe_exp_seq_sn) break; - if (unlikely(test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx))) { + if (unlikely(test_bit(ISCSI_CONN_FLAG_SUSPEND_RX, &conn->flags))) { if (nopin->op_code == ISCSI_OP_NOOP_IN && nopin->itt == (u16) RESERVED_ITT) { printk(KERN_ALERT "bnx2i: Unsolicited " diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index fe86fd61a995..15fbd09baa94 100644 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c @@ -1721,7 +1721,7 @@ static int bnx2i_tear_down_conn(struct bnx2i_hba *hba, struct iscsi_conn *conn = ep->conn->cls_conn->dd_data; /* Must suspend all rx queue activity for this ep */ - set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); + set_bit(ISCSI_CONN_FLAG_SUSPEND_RX, &conn->flags); } /* CONN_DISCONNECT timeout may or may not be an issue depending * on what transcribed in TCP layer, different targets behave diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index 8c7d4dda4cf2..4365d52c6430 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -1634,11 +1634,11 @@ void cxgbi_conn_pdu_ready(struct cxgbi_sock *csk) log_debug(1 << CXGBI_DBG_PDU_RX, "csk 0x%p, conn 0x%p.\n", csk, conn); - if (unlikely(!conn || conn->suspend_rx)) { + if (unlikely(!conn || test_bit(ISCSI_CONN_FLAG_SUSPEND_RX, &conn->flags))) { log_debug(1 << CXGBI_DBG_PDU_RX, - "csk 0x%p, conn 0x%p, id %d, suspend_rx %lu!\n", + "csk 0x%p, conn 0x%p, id %d, conn flags 0x%lx!\n", csk, conn, conn ? conn->id : 0xFF, - conn ? conn->suspend_rx : 0xFF); + conn ? conn->flags : 0xFF); return; } diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index d09926e6c8a8..5e7bd5a3b430 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -1392,8 +1392,8 @@ static bool iscsi_set_conn_failed(struct iscsi_conn *conn) if (conn->stop_stage == 0) session->state = ISCSI_STATE_FAILED; - set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); - set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); + set_bit(ISCSI_CONN_FLAG_SUSPEND_TX, &conn->flags); + set_bit(ISCSI_CONN_FLAG_SUSPEND_RX, &conn->flags); return true; } @@ -1454,7 +1454,7 @@ static int iscsi_xmit_task(struct iscsi_conn *conn, struct iscsi_task *task, * Do this after dropping the extra ref because if this was a requeue * it's removed from that list and cleanup_queued_task would miss it. */ - if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) { + if (test_bit(ISCSI_CONN_FLAG_SUSPEND_TX, &conn->flags)) { /* * Save the task and ref in case we weren't cleaning up this * task and get woken up again. @@ -1532,7 +1532,7 @@ static int iscsi_data_xmit(struct iscsi_conn *conn) int rc = 0; spin_lock_bh(&conn->session->frwd_lock); - if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) { + if (test_bit(ISCSI_CONN_FLAG_SUSPEND_TX, &conn->flags)) { ISCSI_DBG_SESSION(conn->session, "Tx suspended!\n"); spin_unlock_bh(&conn->session->frwd_lock); return -ENODATA; @@ -1746,7 +1746,7 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc) goto fault; } - if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) { + if (test_bit(ISCSI_CONN_FLAG_SUSPEND_TX, &conn->flags)) { reason = FAILURE_SESSION_IN_RECOVERY; sc->result = DID_REQUEUE << 16; goto fault; @@ -1935,7 +1935,7 @@ static void fail_scsi_tasks(struct iscsi_conn *conn, u64 lun, int error) void iscsi_suspend_queue(struct iscsi_conn *conn) { spin_lock_bh(&conn->session->frwd_lock); - set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); + set_bit(ISCSI_CONN_FLAG_SUSPEND_TX, &conn->flags); spin_unlock_bh(&conn->session->frwd_lock); } EXPORT_SYMBOL_GPL(iscsi_suspend_queue); @@ -1953,7 +1953,7 @@ void iscsi_suspend_tx(struct iscsi_conn *conn) struct Scsi_Host *shost = conn->session->host; struct iscsi_host *ihost = shost_priv(shost); - set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); + set_bit(ISCSI_CONN_FLAG_SUSPEND_TX, &conn->flags); if (ihost->workq) flush_workqueue(ihost->workq); } @@ -1961,7 +1961,7 @@ EXPORT_SYMBOL_GPL(iscsi_suspend_tx); static void iscsi_start_tx(struct iscsi_conn *conn) { - clear_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); + clear_bit(ISCSI_CONN_FLAG_SUSPEND_TX, &conn->flags); iscsi_conn_queue_work(conn); } @@ -3330,8 +3330,8 @@ int iscsi_conn_bind(struct iscsi_cls_session *cls_session, /* * Unblock xmitworker(), Login Phase will pass through. */ - clear_bit(ISCSI_SUSPEND_BIT, &conn->suspend_rx); - clear_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); + clear_bit(ISCSI_CONN_FLAG_SUSPEND_RX, &conn->flags); + clear_bit(ISCSI_CONN_FLAG_SUSPEND_TX, &conn->flags); return 0; } EXPORT_SYMBOL_GPL(iscsi_conn_bind); diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c index 2e9ffe3d1a55..883005757ddb 100644 --- a/drivers/scsi/libiscsi_tcp.c +++ b/drivers/scsi/libiscsi_tcp.c @@ -927,7 +927,7 @@ int iscsi_tcp_recv_skb(struct iscsi_conn *conn, struct sk_buff *skb, */ conn->last_recv = jiffies; - if (unlikely(conn->suspend_rx)) { + if (unlikely(test_bit(ISCSI_CONN_FLAG_SUSPEND_RX, &conn->flags))) { ISCSI_DBG_TCP(conn, "Rx suspended!\n"); *status = ISCSI_TCP_SUSPENDED; return 0; diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index e76c94697c1b..84086c240228 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h @@ -53,8 +53,10 @@ enum { #define ISID_SIZE 6 -/* Connection suspend "bit" */ -#define ISCSI_SUSPEND_BIT 1 +/* Connection flags */ +#define ISCSI_CONN_FLAG_SUSPEND_TX BIT(0) +#define ISCSI_CONN_FLAG_SUSPEND_RX BIT(1) + #define ISCSI_ITT_MASK 0x1fff #define ISCSI_TOTAL_CMDS_MAX 4096 @@ -211,8 +213,7 @@ struct iscsi_conn { struct list_head cmdqueue; /* data-path cmd queue */ struct list_head requeue; /* tasks needing another run */ struct work_struct xmitwork; /* per-conn. xmit workqueue */ - unsigned long suspend_tx; /* suspend Tx */ - unsigned long suspend_rx; /* suspend Rx */ + unsigned long flags; /* ISCSI_CONN_FLAGs */ /* negotiated params */ unsigned max_recv_dlength; /* initiator_max_recv_dsl*/ From patchwork Fri Apr 8 00:13:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 559408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57BC0C433FE for ; Fri, 8 Apr 2022 00:13:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232744AbiDHAPq (ORCPT ); Thu, 7 Apr 2022 20:15:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232721AbiDHAPk (ORCPT ); Thu, 7 Apr 2022 20:15:40 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4CC412C9FD for ; Thu, 7 Apr 2022 17:13:38 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237MCjRG024455; Fri, 8 Apr 2022 00:13:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=phRPEWX0KNlZzSLO/NKoVCjTRpkyGXzd2V2+lLJVkwM=; b=tvfNU27OfDUZ3/E7EReXr1ZjoZdlWzMqokz5ElmNKlaFagfb/WpnTZroo+QjNlzErfXq TlvJbXhwUzEdMNouNAyrMbU9Kly5zLjALNJRzHnbI6F1bEedQQu0nEURcFUJS63pghft m8ENs+erQ5KrZfNSrwXFaRZgE/jz/7+eJ5ZYeYPd5yLJ/ikeTiAcmCh9XuJAIbWOgCwg +hehIPsTDevVPBI82z/xORjgWunKsfaefD+Af+F8xkAwAmDTLlvD8ge38pJCmDOyX/ed sC+xxB8Ufu20KxeOe/+fOyevpIBjPcICCvhw75QYe1R26qqR9YJek/eBcdyQ9OoueH+O iA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6f1tdnhe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:31 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 237M7smi029005; Fri, 8 Apr 2022 00:13:29 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2044.outbound.protection.outlook.com [104.47.66.44]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3f974erfry-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h0OWhBPWnSy5KV3s0slsEAN55Si31J4LiF3XRMJlqbQf5tnJfktFZy8LCnwXY5neNhGjHKTh727jBdHxOsLI0IkfXSG3eKyhS86cYgduLeRkEyq4FIWyh9Pv3CO0e0RSNnRAz4H0xlUN0+lgr3dB2F+Ihr+tbKKkfsV9FkGrovIs7E+lo+DEl5ATak9XvtATflZ9MdAEBMbxxqy1KsGhcta5V0B38AG7XniZw9oHtbG3+MvDnNpYtNnCOAxTmO+SjmzUnCEq6py1bsfjgtdcbPKPxWhXro4slH9Ag3mcDByzafw9AKtYk/Vu64VDJf3emrg1EkBXWjE/SDX+9mzKFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=phRPEWX0KNlZzSLO/NKoVCjTRpkyGXzd2V2+lLJVkwM=; b=NZLuZAotPh/I5KO70YThaTd94kkOEAtddby6kUyjDK0TAYlwI5mWqv6SP4tInGINvC442qg9lyMyvSpl6hZRBPY6/Ind4WwYYTOPOxN1JSEvjEUibHUg17DRDNRu4ZOo72Mn7jBWRZoszmrL37nyW3Mqrtdc6pJof60NJvJurL0CH2kik2elgd3UYl2ho9JP2ukcQrHV2Tnwm6/5U1WzgXeEPc6Bw4sl8HBhPBQKncLoZYXKDNBPWcEfPXwGzXo8R/po9ZNF9G/Onke1FXCRo+IHHFLSOIiMCNLk9NKQjBsOdRLLVuXa+qFlioO86g+Mtv/bYv6aNtvuhRugpA5v9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=phRPEWX0KNlZzSLO/NKoVCjTRpkyGXzd2V2+lLJVkwM=; b=TLenZVyJGEIbepon5XuK+FfecZAdOpG0RdxNu3S+bLZsNqlbeJ9wz2PiI7robGG3RJ553o5cdGiuYEomkCrF8FCXrkkLVAIxyAbhAIFDOQD8jl8tr03gwCW7HabSuzM1uylOWLRXYiJNeXkyZjsu8uEpGtWEveYh0lpc4lrzpVY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB3762.namprd10.prod.outlook.com (2603:10b6:a03:1b6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 00:13:27 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586%2]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 00:13:27 +0000 From: Mike Christie To: skashyap@marvell.com, lduncan@suse.com, cleech@redhat.com, njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 08/10] scsi: iscsi: Fix nop handling during conn recovery Date: Thu, 7 Apr 2022 19:13:12 -0500 Message-Id: <20220408001314.5014-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408001314.5014-1-michael.christie@oracle.com> References: <20220408001314.5014-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3262731f-4fc6-4e9a-ac17-08da18f49a31 X-MS-TrafficTypeDiagnostic: BY5PR10MB3762:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S1rLLdUuJDgbsf4J9g7jh1EYVH1Z2QAorX+X4MxhPolBuncji2PTfH17Nssa9hnUqJ1YYy0uaxnRX22XMObKuRBJhPNtMTETKHbdPKVpZ9uIJbTOaEAp7ROnxkXp9R6Bj0+1JRqvnz+5yWwrwGVT9se5iapUoLW3Vd1kpnhI2Lrl9Ob7YgFD7gX778fCZyExNBiFFz5fE4+ifKG19o5Si+02Di8UE8OioMXFiyopjV9rsFXH3fJ/yEDTfSN3jOxFgoNflcAfRnK7Uus0RxHIl+9SFESkBqKKs+/9ZalsHTbZLvCF61eFIasBDtaMv5udIH6IYqVZJlyH7++r8+nsv64y+CPhiMnKh5ysEaeA/6+r2Mde2VwCd0HW0S6euq+G9yrBC6CGtUbi3KsqRJ34a1HxWxMP8SGaRR+J6Cd4mEmuKSq6suaJ6gq+wdRWnJ5OF69DFGWb14yeZ4VPvMzgwimYItEr87tMwayrHcSwF3TZc+8UWjzs59gAUs90D9InOHlZColz0RjuFbW4vqrZlpuPH1a4kqah5f68F0T7iiFEY6UfVGPtHDxGg/y97Q5DL/W6ZZdF+n4b/xpC3Qor0Q2FHEOBYt2KKV7Tw0ti5QpdyPvNQ8VLwVqwngodLO7zyEMgKaR0TKx1eeIc/vezm05bZvEkUSi+lldEakFfdOGuEDA+qwGCCEhQwSe/BV66nLcyDrCFlxYkPX/uGWQ4wA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(86362001)(6512007)(52116002)(5660300002)(2616005)(508600001)(6486002)(107886003)(8936002)(6666004)(6506007)(2906002)(38100700002)(38350700002)(186003)(1076003)(26005)(83380400001)(66556008)(4326008)(316002)(66946007)(66476007)(8676002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DVo5zjG0qAS4qeUD2rK4+UeSBKc4crxFJsN8CigzU9Us6uxolbDZMy/et/UeIsmirfasbEs5R9VO3M1zmuMkFCOozb6kaIjR/wdGvW7NpM0wNHHkqU4c/ql2ONVnz3iD0BV+PYJIb14Ba6LO1t02nHtGfnZU/DFuy04Nt2KQ4FoSRyYqzYFldjXnUmWGs6yWW2ZYKTAZjvEnbpKEBxAbIbE3c9WsKRpLEoYBEL2svI2NkTCtPrggiva+W+vi2Iblsu4ika55X1D5CgQBH2XD26goE/IfqWrsiXaVMkehFs+mzCzuc7g2vU1WSGVmzu+bLtr52Zfz0n5ncCIX/2J1LHzdYOa8e8Q8ASyjvKjuqZe6jgctw+Jdz/CRz+Mg013R3/nuzzJMtLdv2hVix2+Guu+FQDxqBf5s592aQeyYJFKO+s2YPGFu6B4s+g+2AxnooDql8S1Um4nToFbsBLHsEfrmAbNxMtOmk0cCRmU4nu05lY2dKOSHbngFn1jxm9TCC9LjhSJ5+PIfdIxwbBE4rZxkNXvVL8tBgG5uKWsJ9aEDGyZ/oNVGPm6s8cIpufFgUjo5wJxxPHjzV8C/gbnPuS4mhcvszS7BmED+CZ/suu1PrkYt9U2lizm6NHoB+xSQXEGwciWJWwGb41OBZldMgdzxiaVmDae87mplcgqz5m8bz34OnKKL3BCHWl8Fask6wCfmx8wI/G3XZU2c2VOFt3x3NekZjiD0AtTVhD9/Qawrn3xdqnkL3yf18ZSvm3Pp+3Xuto1T+PqAVv/c677XfUAe8rzQbMsmn32xpBcRB2MYe9C6A9fv5Nx+iSeXYIGoD95I+uKo12HjylfdA+C8hHclSkPTADLXLVpeCVaOsgfJrn+ej60Cqva7oLcS960BsTRK4LohpleU+G4aCeFOvm4Q7kBK9veKuGkcZNamvl+1TbH0bAiH3cCkGUKBxvvrQQMbE0zh4brgkPeVMjWhqvY4Lo5CB4fPVoSSJAUOpCvLU+N8uKZH/3/46PhaYds3Klatqm6ikWoFVcWE/Iy0QWfva9SIIN+3Kf0KCixOb+7FM0XBlwdVVNGle/WMqXKUJKCWBjGsxSRyvAgRv6o0BDxaJjSOU7emd0qFCzTBhLOYsfPufEu+7+4g4foy/byM2z8fPhsXb7s7ePZXDK/nhs8WiRimOzGljJ38tVJjhTJZEmVgqqFL/oD1TxwNh+A5OI+hS1rraXd/TjmOHTGokC06xAC65SuvrfBQk/VFXXAGt9F4cfqSwxVyTmqrkHYDKEQFvvWEomE5W2Nn4cb1NXU4ulIhhjSQrK2ZkUOwzL5a8TLd9bRhU10Q3u3YAbz9HibhIlYwFy5XR+JPN9sk0Fj8WK1Wpc4l4dGFhtDPV7LJOxkd3DRFArp0QoyGx+RWxcP3F3jaAzieMB4CS9C7blIB5YOK6euuhM7wHgfBDSGAKANVvuCR6/zbMdC/nUzQqclNaZm643E0CXqInzFg5WFZRFvTQV5zHzkafeLsXMkMt4U9qLnS8h1iq6WWS5dyj5O3tLqd0CfrfCK3iCrmzJ9VuVCnFziecjN2/3ob3VS+OnoFKMVH9MNSWaab40ZiGNg2c1I+pWh7XLHYyyw9SG89C4hRmKPbLuJ4/s+J4jv/TFWTjsa1BZ3yOswJCBSxzxGnOVUdQbNMsHUc/6noJC9VlmACl4m4c6rh52/HBi+qwAP7bkqBuzRirlwqImfgIEDeYVexMZe6HoMqMulnEj2hwNka2RQzuL/zVPO49Uk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3262731f-4fc6-4e9a-ac17-08da18f49a31 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 00:13:26.6254 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: t8MRWkd7M9Ce3rW1cjdEK9bPBLA3ngOwQdUKhTS0kO3Wlite5bmRB/vazxWPqFEtKCEB98ZoMwpBB2sa26fEFNcKWdmYBhvo2Sdp4u7fQIs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3762 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-07_01:2022-04-07, 2022-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070064 X-Proofpoint-ORIG-GUID: HyR131o2hxw5XwJVcPTf7Uo3MJdMh_ta X-Proofpoint-GUID: HyR131o2hxw5XwJVcPTf7Uo3MJdMh_ta Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If a offload driver doesn't use the xmit workqueue, then when we are doing ep_disconnect libiscsi can still inject PDUs to the driver. This adds a check for if the connection is bound before trying to inject PDUs. Reviewed-by: Lee Duncan Signed-off-by: Mike Christie --- drivers/scsi/libiscsi.c | 7 ++++++- include/scsi/libiscsi.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 5e7bd5a3b430..0bf8cf8585bb 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -678,7 +678,8 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, struct iscsi_task *task; itt_t itt; - if (session->state == ISCSI_STATE_TERMINATE) + if (session->state == ISCSI_STATE_TERMINATE || + !test_bit(ISCSI_CONN_FLAG_BOUND, &conn->flags)) return NULL; if (opcode == ISCSI_OP_LOGIN || opcode == ISCSI_OP_TEXT) { @@ -2214,6 +2215,8 @@ void iscsi_conn_unbind(struct iscsi_cls_conn *cls_conn, bool is_active) iscsi_suspend_tx(conn); spin_lock_bh(&session->frwd_lock); + clear_bit(ISCSI_CONN_FLAG_BOUND, &conn->flags); + if (!is_active) { /* * if logout timed out before userspace could even send a PDU @@ -3318,6 +3321,8 @@ int iscsi_conn_bind(struct iscsi_cls_session *cls_session, spin_lock_bh(&session->frwd_lock); if (is_leading) session->leadconn = conn; + + set_bit(ISCSI_CONN_FLAG_BOUND, &conn->flags); spin_unlock_bh(&session->frwd_lock); /* diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 84086c240228..d0a24779c52d 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h @@ -56,7 +56,7 @@ enum { /* Connection flags */ #define ISCSI_CONN_FLAG_SUSPEND_TX BIT(0) #define ISCSI_CONN_FLAG_SUSPEND_RX BIT(1) - +#define ISCSI_CONN_FLAG_BOUND BIT(2) #define ISCSI_ITT_MASK 0x1fff #define ISCSI_TOTAL_CMDS_MAX 4096 From patchwork Fri Apr 8 00:13:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 559406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED240C433F5 for ; Fri, 8 Apr 2022 00:13:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232759AbiDHAPy (ORCPT ); Thu, 7 Apr 2022 20:15:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232734AbiDHAPl (ORCPT ); Thu, 7 Apr 2022 20:15:41 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 394F612B5E0 for ; Thu, 7 Apr 2022 17:13:38 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237Jv8j0005378; Fri, 8 Apr 2022 00:13:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=h2VbVoXicP5hoOoxVea5nKUJqSWFKhYSrzCPAk6yHQY=; b=ZkiZzLKgTvrlotiU1tOYxig80pS+8r0aGrEFdthPvhiqJFeM1CEwJ4iUlIIPq1CPq5la eo7Wsanas9SaCZppcZ0mreFH1CfDaJO3dgoohJlBRwaeak0mQZME/hcnyIITTjXxeM5d X/R7ekY1JCIV4xdPyvf66yoPjuha6aWjx2GSE2izRQSN2+Jyrg4dA9Foqq2T/TGvR0Nk oRV0kURPmIy2zUh4OEO+vnClBVABDdRTuXrdxAacbIUGEdy3Aqf0zIr+A3uA8J6FmyMl uDN6B4qE7kk5PAU7xR3Lzv8O4y1jhuZwVU6VIgE/hTapl0JYoymr9gI+mEuljNsFkp09 kg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6d935env-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:30 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 237M7smj029005; Fri, 8 Apr 2022 00:13:30 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2044.outbound.protection.outlook.com [104.47.66.44]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3f974erfry-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H4PUTFlb9iJ05W5xtsxCjcoyGMfGmJuny1kGsTbUPKkuLLNgVDWoXP21nHaBIWRLRdWt6TIFcv148UlSeBp6Sz1qGt2AzdRFd5ikjt+4fXeePcMCpPpjqo3rnMdeY4/kxuQSnrGg5o6j3tshNhbRFGTrRfN4d9Ig3mYqr8gAGrxCebxLAorf8fkwhK65sNLxNyG+LkwDSNSxJJ7Gq/5Yxx6C/oMHe7ezMf07HLCZwzznTjl5pIa0XFVz1bQxWvO5kM7hiGeQDEBCtINzn2mlhxOcnjXoiaFxohgzRY2/NBIMA/LuQo20irhlo8fokz+G8/JqAH5WhSmlUUyp8u+1Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=h2VbVoXicP5hoOoxVea5nKUJqSWFKhYSrzCPAk6yHQY=; b=POJ/+cnNxjcT86tttsLu4nWYODsONmQJaZa6Y1Ar7rf6HE4JROJxDX1Cu057TZtZ2uQ/19tUYuv/xePXXtlFENI3PTHnt3GhmS9lf46p8Y2kN1sTssbCrVvtcg8IsM7pQHZfODWd4Ux7WVBOvbGSg8QfZRVm+MmzxwhhJsM6MCjY2isYKD2wDN/x79/D2NvljBg1X0xnQJmBxxgI6F5thMMN71b1cAPUkYM3u32QCLwgxF2feQOZsUR93xP9dRD3zYPZ6fzCvxuz0Kp7rdRbaBRrg85uKE3muhAa1EDqQHU4SyAQgruWwwm5cKBAWz7bRXQ9YxhKdUoHYBcZYeVR+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h2VbVoXicP5hoOoxVea5nKUJqSWFKhYSrzCPAk6yHQY=; b=ntsKTYqF+XAMfVM17qF/n7dsszTa2YDCTbKv2WHDXsLv8cH4XDT5x1sPNlI3RxWMgZjtkTto4wI/x9g9PjpUAQNByVid++wKxQ5uwZDZdvBgqBwPqjlfxIxLOnK+1otoqIN8rOChawdvP2NaijShta3rQtFL8ZM4bPKCVLNM5Qg= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB3762.namprd10.prod.outlook.com (2603:10b6:a03:1b6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 00:13:27 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586%2]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 00:13:27 +0000 From: Mike Christie To: skashyap@marvell.com, lduncan@suse.com, cleech@redhat.com, njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 09/10] scsi: qedi: Fix failed disconnect handling. Date: Thu, 7 Apr 2022 19:13:13 -0500 Message-Id: <20220408001314.5014-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408001314.5014-1-michael.christie@oracle.com> References: <20220408001314.5014-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36b3af9b-679b-4758-e125-08da18f49a89 X-MS-TrafficTypeDiagnostic: BY5PR10MB3762:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z2gvGm/QZmfEZbB8+njzuSNxmyXC5NP5kHQ03M1d6xhemed0VYTHk9MZOXXhJY9qUxzxAeEx1dNUamm0hEOVPNDD+TlT+6JpmbxZ3Eeq4A4WtQdyZa1KX+O4GMvVBKxC7UxpLkCbCHBl45FSAVNP5nDhPkl9zQI8VUcsqavBfyEXoKRVzk6cdhvmoP+hiTRoRezbhrEbY7PUYg/m0DXusufUR0y+/Zx8MhVTjaUMGdNjiBk8n6e5h/bTDzI49O5pisYfulEYhyaGSXaKX5P9FYoUABBZ3QHB8TFR/dOt1ndmMCAKhXrQKzAnPwwrcA2v1yNtKrFRVW603mkj05jgV4ENFodCI+TOgychA/I+BWRvKF5g/GmhqHl163HK/GTVZrb25i89YNsB82YkfV71eO+nPQj673I9sSZcTNRLT5Vrl0XPHj0ESEmBeAiYhqFWAT1Yrp+guUK+BvwdEsja4t5EzisEqE2lmrFw3wzGUlPTI1iBsb+R4ZJPpESGiuoFCxeq+CcB63GN8Vpe6h7HZp+9v85UKUVGJ/Pi4hVxJOKhJ21f5xa27jPOz2PLaM6x+Us0yUMqWW9eYTWsHJ3cW/SeG3LTpSdrRf9w6m2lOurnM4UE66l7Dv4trgcoJaqAGKdbNwfTkQPIv7M2Ay/Uu8KaGg+xTAgou7CqsRQXSueWCZBoSL8M5Zxdoz16PMY9wnplnYle03gI1CoeCCp3aA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(86362001)(6512007)(52116002)(5660300002)(2616005)(508600001)(6486002)(107886003)(8936002)(6666004)(6506007)(2906002)(38100700002)(38350700002)(186003)(1076003)(26005)(83380400001)(66556008)(4326008)(316002)(66946007)(66476007)(8676002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: v+JIujZCqaogwjUTca1twJW8jONb2b1I8iMq+5ZEJsLtNUInwFcQPvIRz3MKmyqM+ewfbcUxyylYxKUJFifedp9AkGMLLk4K6dvshdjb59QgQ5lGJQrBeqQkochnK+5/0eObyAURhCntGmQBUXTbzwQJB0gGUdmYNgVMW7SNOSmgUZ8yInfwo8fZdNTzeZ2LiOCMSqfQ8LrQ6iRHfRSTY+qCIngj2ZUIpKr1zrEiavMKeHmXK/BMb/mgn6iMN4DJIQ5JE/8vxj0jOvScNampLZQ8LPwr4AiPJdOpRwHRa3/gqEop5+XhloCI/jzSDXLwwsSfT4CEdAOIvpnEH+zGdNe3+WjhQ7kPo+ALJIMT/AISmNQY28MZ/vhro3xRN5Ohe1J2p6rLeuKE22nPbOO2y7DS2I/ZbIRwCRhG6fQoTKXpGb5nBpUhanFe3Zilw4i+9j6unArKLGPH42DCHoSCa6Fw8CsEpRNNCO8mDtGJA10f1BKxzvbM1v19wQzgOPE+n9zaLR5lH2cn8I6NG3k8WTr6Eao4U/RQfmJLvej0NwK1YFKthXv6OJMduSUN2FGaVTVAEwHEXh3lM0i+W+apPgWHsIe8JvIlKspa0H1vJJ/4IHEPRUOEEj7xPkkjEYgcayPIAjPhhZVbD+h5vNARofP3G7IQISgRZqLSZw+gQSutA92RpcRuCYqGhiSO8fY7YGy+zE/WHBEKCow4zY/+cAz+fT5PkhDzEiAAHk63lE+pfmxNrysbkR2RCBDrsAmhwRzBLX8BbLtxqQGeptiLcUwzlhOeySjQcz17nvAGJtHTX5aMEISLepfxlUTQtGeHk/be/dbPvLYU6fhNkhfrIwMmIGvm73Rn0jaE/61zl+csufZsWIprtH+kIJ7NrcOfzNT+oG8twzoZEsqv6If01Tkd2CzmEuyO8P7lnjEOuVNTCY2jzRTXqyf6YMQyK1RzmRPk10ySkEY8rGxePggzdsU2QpNcXppsKIreO1BPzYRq9C9gd/suG1Bbgadolf+nS9G4CYrhtCw/fuhJWCvbeeWJJbJfsVbC8o3ZUQKKbnyz4rqhE09ao4iVM0WEmpydWhqccwZwFb75+/fWsMfSNRD8Xru3NiVZJ137YQmCaQle2nZbYH+qL2LRwfrCTVPIQSsH6rh0WiRFcZCWbjesM//zWDreVByqpL/gDe1uSE6ckN4BPYm1ybooZGYECKSw21uIEGGQ+3Y/Qviq/0BiZDPEO5geaGRVYDnygasGaqZDCdAu1LPh5FiA5iKMOQuX334YT2HRvI8Qd5zwypVKtAzsRiRvR0p6xuYE5R5AaVXO2INj6UlpTIUxb+XYptx2sr0/wbK6AvCscxeuNpVNjNMmfjT3j+gR+62SFWGmmrbF+AbRj2prGZeqXlcLBAyVOuJVnbwpqKn5LyZ71r+mCM7MJ9v9SyOJe8nVy0Qz9lx0m8QJ2pjx1QXcW6wy4KQOQlSBQShX9/yb7V/KDBWOR5hoBf7rWdj2kesOsPh/S9L6+DUC9zB1Ov3EL9Ur1hIafmptoMJ+8J1qABTlhTTjoxKSrfUH5/la2DEPK+djO2OwO6kjvAhXXwMK0L+lnCBNpnSksptuK0c5e2g5zC0kdIegwk04ZePb1OwsZ0ILa5qemhaLGIZvuT7GFmT9EBAaw9XYcTcWGu+dJembL0xzHbYcT86hrR8h+eTkVpfG4b7+SHYUHufcrGWk5onpPGs5Ql2gx8iksOJJxP0sczwMZVB4JAHD01uRH12v6JZ8cxY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36b3af9b-679b-4758-e125-08da18f49a89 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 00:13:27.1410 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QaI2MqS8Tpb8O+1Fl6SyHrNc/LgnxIACv4lPhLaxAlVwQeLKOuVLLHDoeXIBEcd980qP4VWCRQP0Suj11tWOLqmheAasvtYdmGJhKjCylTE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3762 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-07_01:2022-04-07, 2022-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070064 X-Proofpoint-ORIG-GUID: eZWPc3bD0Ey-F-CkJARMwDWGI3WkSkgn X-Proofpoint-GUID: eZWPc3bD0Ey-F-CkJARMwDWGI3WkSkgn Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org We set the qedi_ep state to EP_STATE_OFLDCONN_START when the ep is created. Then in qedi_set_path we kick off the offload work. If userspace times out the connection and calls ep_disconnect, qedi will only flush the offload work if the qedi_ep state has transitioned away from EP_STATE_OFLDCONN_START. If we can't connect we will not have transitioned state and will leave the offload work running, and we will free the qedi_ep from under it. This patch just has us init the work when we create the ep, then always flush it. Signed-off-by: Mike Christie --- drivers/scsi/qedi/qedi_iscsi.c | 69 +++++++++++++++++----------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c index 8196f89f404e..31ec429104e2 100644 --- a/drivers/scsi/qedi/qedi_iscsi.c +++ b/drivers/scsi/qedi/qedi_iscsi.c @@ -860,6 +860,37 @@ static int qedi_task_xmit(struct iscsi_task *task) return qedi_iscsi_send_ioreq(task); } +static void qedi_offload_work(struct work_struct *work) +{ + struct qedi_endpoint *qedi_ep = + container_of(work, struct qedi_endpoint, offload_work); + struct qedi_ctx *qedi; + int wait_delay = 5 * HZ; + int ret; + + qedi = qedi_ep->qedi; + + ret = qedi_iscsi_offload_conn(qedi_ep); + if (ret) { + QEDI_ERR(&qedi->dbg_ctx, + "offload error: iscsi_cid=%u, qedi_ep=%p, ret=%d\n", + qedi_ep->iscsi_cid, qedi_ep, ret); + qedi_ep->state = EP_STATE_OFLDCONN_FAILED; + return; + } + + ret = wait_event_interruptible_timeout(qedi_ep->tcp_ofld_wait, + (qedi_ep->state == + EP_STATE_OFLDCONN_COMPL), + wait_delay); + if (ret <= 0 || qedi_ep->state != EP_STATE_OFLDCONN_COMPL) { + qedi_ep->state = EP_STATE_OFLDCONN_FAILED; + QEDI_ERR(&qedi->dbg_ctx, + "Offload conn TIMEOUT iscsi_cid=%u, qedi_ep=%p\n", + qedi_ep->iscsi_cid, qedi_ep); + } +} + static struct iscsi_endpoint * qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr, int non_blocking) @@ -908,6 +939,7 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr, } qedi_ep = ep->dd_data; memset(qedi_ep, 0, sizeof(struct qedi_endpoint)); + INIT_WORK(&qedi_ep->offload_work, qedi_offload_work); qedi_ep->state = EP_STATE_IDLE; qedi_ep->iscsi_cid = (u32)-1; qedi_ep->qedi = qedi; @@ -1056,12 +1088,11 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep) qedi_ep = ep->dd_data; qedi = qedi_ep->qedi; + flush_work(&qedi_ep->offload_work); + if (qedi_ep->state == EP_STATE_OFLDCONN_START) goto ep_exit_recover; - if (qedi_ep->state != EP_STATE_OFLDCONN_NONE) - flush_work(&qedi_ep->offload_work); - if (qedi_ep->conn) { qedi_conn = qedi_ep->conn; abrt_conn = qedi_conn->abrt_conn; @@ -1235,37 +1266,6 @@ static int qedi_data_avail(struct qedi_ctx *qedi, u16 vlanid) return rc; } -static void qedi_offload_work(struct work_struct *work) -{ - struct qedi_endpoint *qedi_ep = - container_of(work, struct qedi_endpoint, offload_work); - struct qedi_ctx *qedi; - int wait_delay = 5 * HZ; - int ret; - - qedi = qedi_ep->qedi; - - ret = qedi_iscsi_offload_conn(qedi_ep); - if (ret) { - QEDI_ERR(&qedi->dbg_ctx, - "offload error: iscsi_cid=%u, qedi_ep=%p, ret=%d\n", - qedi_ep->iscsi_cid, qedi_ep, ret); - qedi_ep->state = EP_STATE_OFLDCONN_FAILED; - return; - } - - ret = wait_event_interruptible_timeout(qedi_ep->tcp_ofld_wait, - (qedi_ep->state == - EP_STATE_OFLDCONN_COMPL), - wait_delay); - if ((ret <= 0) || (qedi_ep->state != EP_STATE_OFLDCONN_COMPL)) { - qedi_ep->state = EP_STATE_OFLDCONN_FAILED; - QEDI_ERR(&qedi->dbg_ctx, - "Offload conn TIMEOUT iscsi_cid=%u, qedi_ep=%p\n", - qedi_ep->iscsi_cid, qedi_ep); - } -} - static int qedi_set_path(struct Scsi_Host *shost, struct iscsi_path *path_data) { struct qedi_ctx *qedi; @@ -1381,7 +1381,6 @@ static int qedi_set_path(struct Scsi_Host *shost, struct iscsi_path *path_data) qedi_ep->dst_addr, qedi_ep->dst_port); } - INIT_WORK(&qedi_ep->offload_work, qedi_offload_work); queue_work(qedi->offload_thread, &qedi_ep->offload_work); ret = 0; From patchwork Fri Apr 8 00:13:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 559404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B89CCC433EF for ; Fri, 8 Apr 2022 00:14:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232762AbiDHAQP (ORCPT ); Thu, 7 Apr 2022 20:16:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232684AbiDHAQH (ORCPT ); Thu, 7 Apr 2022 20:16:07 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77F7C14B84E for ; Thu, 7 Apr 2022 17:14:06 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 237LOlUG024505; Fri, 8 Apr 2022 00:13:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=kRmbCquSf+yQslvAzTBagyoROYOlLf8ap5p8EmNDY40=; b=p8VAqHmyQDofmFuV7Ix0oG26mOAXhZW4VTz4PftOWcaaN0fiXNVmhOSA0/rTSnEdz2+w ySrhn0Bpx9fXB1TxlbRMy8OynNPK9DyzK6jpmqCH0oZ9EbfK27Lq4Ed8yjubE74f+5/L xRsAdJcp4WGAwZ1lCcbbWoFnTyKaWSPf2wGPuN77K8gpNxIj9IKd1ZUxekpzBdzx11W0 bNGQStL0qkBrs6CZDm/2IaT8Q2wz9fYSaUdpajlNzNj1MdmJOWeVrc6SMrI6GGyTzaXX +LKpOvln+yeZ759tjohg4OHcnYW4XaHsKzvblj/1rUoN/98q4xweEe6q+GPb+7qHN1A6 9Q== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com with ESMTP id 3f6f1tdnhf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:32 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 237M7smk029005; Fri, 8 Apr 2022 00:13:30 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2044.outbound.protection.outlook.com [104.47.66.44]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com with ESMTP id 3f974erfry-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Apr 2022 00:13:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LU5n16jjz5LNkuAm7XVv+c7dsRRERci+Gox79G5TGCUhj/mWhfcw+PPyxJVxfKeJc48n5W45FnseJ04W4W5YeaYdvBo6te5vb4OAT5Hn+cszeVTQ2yOKbbyJS1SiZiZTUNblwQI1ozU9AWzk3WhkPb8Ym2RS4Y9OB/sKMqoMNzZXA6bkYNo+B7Iicpnc8myv8bb/+jBseNxdfIu11vEAXoqY/9KPJ8pDiMdKkmYU7ZzwCvfmJfy24aQOHQyA6aRUizM8iEM8LGDBTlh1eC7WDtN5c9wTBSUxDIv2F4zpic22QepVZyaJMHHpNrlflB34JqdEKVXMgOmCt+ByCJcSyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kRmbCquSf+yQslvAzTBagyoROYOlLf8ap5p8EmNDY40=; b=M/Vlym9WImBT+vmjDisA8NGtOzs1vFsoOVjzxFIuCvBCrIvjUdHwjF4sgLHzH/OhmLJ/71CuxY4+M0HQWO3DBeFcRLcuUET0EB10XWLzQgwFkc/bdfP+crSmMRojx7jOR9k2OsJ4v/DX1fQRB5y1BKdfaFD0z/R7K0kOF4r72h7bHyJpiPpaaubJxO/ysotQH7WPWKKyHA/sKRFmQCAPGkP1E8q46w3rRG8Rl9uUivgfOxZ9d/WuIcBhPxbNPmQzFo+IOykkFHA8p6qUc0rOiB1zVD85oWYLXM+5q0FNGxHxmXsGQ0ahIzn6ePBzc/nmX0woZ5FstsyIbNFZsyLZ2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kRmbCquSf+yQslvAzTBagyoROYOlLf8ap5p8EmNDY40=; b=gELbOApNRZL+vQa7Bgd+J5T40dFyzJd58n8mlFXkgAfXVnufyviwXWYAxXOGuiKDwGTbshMCjAoDl1kHLoVQtHRe9oujy+l+HE8QGtRBkyG4jaOV+JqeU2QuCtQQAT4gmWN66NUsSYqS+0DdeZOprile2MVLz5z6b+NrrAGGsaQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by BY5PR10MB3762.namprd10.prod.outlook.com (2603:10b6:a03:1b6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 00:13:28 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::3cb2:a04:baff:8586%2]) with mapi id 15.20.5144.022; Fri, 8 Apr 2022 00:13:28 +0000 From: Mike Christie To: skashyap@marvell.com, lduncan@suse.com, cleech@redhat.com, njavali@marvell.com, mrangankar@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 10/10] scsi: iscsi: Add Mike Christie as co-maintainer Date: Thu, 7 Apr 2022 19:13:14 -0500 Message-Id: <20220408001314.5014-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220408001314.5014-1-michael.christie@oracle.com> References: <20220408001314.5014-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR17CA0022.namprd17.prod.outlook.com (2603:10b6:5:1b3::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6cdb4c81-2403-463d-b3dc-08da18f49adf X-MS-TrafficTypeDiagnostic: BY5PR10MB3762:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dm1XBXEh6MZsS1pTUWMKz88sZyfwXvzHH/DYTCIWhmAiGXR6EkFgyTGvzWxf0Bwf+ba2d1mWfsQS0Y5ngRrG5iLiZRgqipvYTVC5ZYZppxafnpuCg5kFuic3qEoKyZMW6aOcRgvnbNFdKjHXerIf7vq5M10aLC9WOAVcWlto3PRASs/42oHQSD+eHEyLV4lMFua+rItZBWl51puXlCyg1YpV8VC6sgGwMxJqdfcOKW5HFcufElo9WODC1t+U+Iw3Mh6yYVycmhTA0VGzw8TtPS0UYasKN1oKSfkqHKgQ09KRb7hL804HuuHSOEmJyPhS5CIGYvrqma3nssCKAi3tdzEpRFNZe8o5zchyun2bZIi3tIXjdMibPvJiAFh/7FlmQPCmY0dyuGR2AiVSsDnNhFyb/KhlW8E/gD7aJ5Lfu8x3QxD1GVr2MiXhx91DuFIlrW/4CWzc69cy4s/u3GLS6jlO2hkcbcV3mpwv+ZW91D5WnSljHVnq5P4aR7nF0K6r5xRxzQIFc0iykgAMjMlY4ibNftHUyugGZoywq09dYEdD8wLSpru1jcV10TnUp0Xua5GRsiNMRCmm+mOKiOBzawQTBLgNbWZANK1xdDnDpBmXVUDy2MjpXW6vEYzSYoG20eJXD2v+rfyPJMm35VntYFaDCd6OW2xVGiIu/YrDNWgl0lxVm3lQnS47sL9GEZvcZsbco3Vs3fQ59lgawMOnzQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR10MB1466.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(86362001)(6512007)(52116002)(5660300002)(2616005)(508600001)(6486002)(107886003)(8936002)(4744005)(6666004)(6506007)(2906002)(38100700002)(38350700002)(186003)(1076003)(26005)(66556008)(4326008)(316002)(66946007)(66476007)(8676002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QpyjlLi6ZbWD6/neCiATowA0RZxqvgrjGr6hCYO6vsd9v2VFYwrQ6tPYRCdJksyUwKdaboBFLxwuiDd6uPXhnCu8/fWV9kp/Dc7OMi/mnoGwBpDEWOZNaJpBOuXVNsDp3llhhoqOsIZ1InoKS+DA7wmrj79PHGvyNhaiXfBadgsGRlE25C8QmEveqq1o+bDiSP2K5Tl/AVJ1Nri65pgsyz1CrW24PuZJuG9A8sqUSp3REOcFN2l4ZP0c6i3smjDHUDwOzCMVaeady2hJFM6U0sP1RRSf66/fvwnk2Bd07Ar6LTvZYuNWHOCN/OzbbzLIXgbFn9Qc2a9daJuhPHRAKUb6KWoVG2kO1/X4KVgRWbN5M35IbbLm0Z7hRrjnBaamEq9CDR3CVNsig8bQTJ1IjgjTODlw9iAaLGFNVPxNaKZj/oK0gr0epKGVaatXl4i2VsAxm+G9C4Imx6/fa+NBK5D2m0UexP2IhC6LHg4gUwJkmnbkeecszvHyeU8fhJ/8KYWCggNnmXN65hMhc1DqnaUoSbQx+lmrNikUCG2cgl8iG//q0hvZtDBmDrgfKfyWiv60Q0YfjHLHO3UmBsf46z6FGeWvQZGdzdobH7Qn6lEAinUENJ8Zs6Noi4jCw1LPvN0vI/lppf4Q+FpcVMGdq3FdIUrJi6lQZtJwv5Ez1VaKTvgPmx3xJ81HQgMVp/NmHLYP6R4k9jVWi/He8EFpbjRbNUSMxDJjs5ntxW9UjenJP00kRgGFT8cLHDBmA7+HsB+AYpXylTD3L8svznemfQ6+6vZ41U1oqbMPD3tO4eRhZCLaqhlTeBtmBy0oK3cxM+99Scl+kwM6cvKaLpnOHaeGmqeiaxIGv+I9uMez+mKiMM/HGDPcsh8qMpLRexoozV+95ErKu1anJ2aMx6or+CJf01jSGPAFsiKoQWYExcCRjuDcLW/B+Pe8NlQz5jJCrmiIBv0RrqkRfqPr/E7iKK1y7C//Zr9HtZK1/TGv+mJUdUMGUNTb1p/kHQdIawuN65cd87w6ERKMb2sLWStRPuxrxs7c17X/AMU5b9tXmG4s/EBOthZOjqcdGi4Zf7v7Nd0zweKnTL1CczGNxMJsGWiaDqSkavKxcH6qrHTG6/THO4MuM9TYuN3tq18npNqg6jx/WKk64n8ETmioyOZuysxMYuXEwmsVw1N7vZ+iRTchsTmnGDh5dA4pDIM+rWm8l9f3sOvV8malbFt1TYme7zfvA/r1ubpSfa7bFuFyHRBxVUTD2RQ12iJN9QKb5xgafnKhYx6ln+VY4X6HQukKOcQyhmtmxzm3A4f8Xu2wzqkSC4ChuhtGtiCzlBvtBuNJ8loGyJkJ8lpFB2/RPtK8AeCSeQ1p+YDhMK1CCGjfadbOjVEz1BR3ex9ZIDj9f/W/7y+YWHvzKDRlQOgWvi1PxGc+LpRUFNCEBM6WQvkDT88sPi7Pzz5iHr9eKNqxBspjeWb+YO4wftBH2EszE+NA43q72S1zDxczoJF7kqEebhVykHSPlDOTE3bdrUWVBPPBsZkuY7OBDGYvMm21eEFcdo1QWz+NGpl3fQ902GZgwoY60tR7TpJb+EZmeQgzuVeuR/r4eT02nfF3kM21zIjaw6WBwQBi8msLVhQzyEn/KVJwPQgNHAzHcoStEWj5Y/UuqiUrbWN90C2qTGMOqV7dy9O8+iI630BcrUqTfo/rOo8o9BsUJoX2ORsYFeX6+XaAx8maD8MNxQlfGw6AFDuXMvc58G8IwIJWfUbbs8G+ALA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6cdb4c81-2403-463d-b3dc-08da18f49adf X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 00:13:27.7035 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fmQhMK+EGvAxYC5dMtUJS7cNT1w+gie/tgld8QsMBkMHb/6ghjzqIlgnmgn+kX22X2iObSCDdU+POTQIOMYKNk8uOMQcq1posbDnHmfGh3w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3762 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.425, 18.0.850 definitions=2022-04-07_01:2022-04-07, 2022-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070064 X-Proofpoint-ORIG-GUID: byqYYCflTz8sHjuXqckRIUc6qFTGvEz_ X-Proofpoint-GUID: byqYYCflTz8sHjuXqckRIUc6qFTGvEz_ Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org I've been doing a lot of iscsi patches because Oracle is paying me to work on iSCSI again. It was supposed to be temp assignment, but my co-worker that was working on iscsi moved to a new group so it looks like I'm back on this code again. After talking to Chris and Lee this patch adds me back as co-maintainer, so I can help them and people remember to cc me on issues. Signed-off-by: Mike Christie --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index fd768d43e048..ca9d56121974 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10369,6 +10369,7 @@ F: include/linux/isapnp.h ISCSI M: Lee Duncan M: Chris Leech +M: Mike Christie L: open-iscsi@googlegroups.com L: linux-scsi@vger.kernel.org S: Maintained