From patchwork Wed Aug 10 03:41:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596780 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 44FDDC25B07 for ; Wed, 10 Aug 2022 03:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230206AbiHJDmX (ORCPT ); Tue, 9 Aug 2022 23:42:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230163AbiHJDmM (ORCPT ); Tue, 9 Aug 2022 23:42:12 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28E9372EC8 for ; Tue, 9 Aug 2022 20:42:12 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27A0E0eE025960; Wed, 10 Aug 2022 03:42:01 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-2022-7-12; bh=U7iRm/CSUXDeyXCiUfmTkqapuKQ0tr9/U0yAlV+LZoY=; b=BCmxmiZMz9m0e1Q0zvmZ0cgq/7wd7UdObbdxr6PLPe6hkglfmBH5jXHEMTtCQ00zYb2M d5H1qncvyvHAaO4B93DLpZ28hL09P/ypD4fIcVbxn+yTrlDS+j+lZUyl56ILECY/1vv6 /q/UHbT41ks06RS01892wFsClbSgyG/jgvzqPUfPI1US8vhDcAZRtu60CPLAMmqEz87O nj6tEdna1o/BkmA2GdtaoIz4Ce8Selfdgpka04Gs9dolbiulc2uajJ0kSnhGPYDkHp4R emt35PjgXnL1dMk02SyssLhuNk/T48gsb4pNecO2ScklJK1G9BEgJ7KNag+lYZ986tG7 kA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwqbgqwq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Aug 2022 03:42:01 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27A0YZDX036587; Wed, 10 Aug 2022 03:42:00 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2049.outbound.protection.outlook.com [104.47.74.49]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqfgyvu-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Aug 2022 03:42:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VK+d83b/oTd08Rk20nnOE8vngZmPhyVfmM4zr0ylcv8xaB3pQZzO92UdoaTwVajBy+Vh9xKg4V88Wr50rhnikFF7BH2mXvIwun4Q0QJm+zL8udXaC2y77BU+LQZJZMnYccNsNXhuX0/9YEu0DLeuzD72y804pnGTp6iB9i84C8GZkRDhhd9QS4QdNy2Py5LJboSrhNt1/eYJxvl9Dq72qFyeXr47eGSr6qeNPjaR7u+0ddfC5Lkf4nzUd+/vUgtgNtCS1jx9AX71AD9CZs5GERSGGy9UmNpo6qKlVMJHIfqa//b1Zn0n1eZUJYHz0L6lRJmuOwcrSR8/stl7SQnY/A== 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=U7iRm/CSUXDeyXCiUfmTkqapuKQ0tr9/U0yAlV+LZoY=; b=i7ZuOuIRitBJtSpq5DdL+nRX5CbSC+0SeNXaLKNgfwDePcEi+69OcNaZQopjChaAX0uEtxVaz0cEKvtJoEO0oGqmK1V+ShwjIB158Gi0DHI8VPrzMOiZiO8Gw7Sm0203pR7U9ImaqcQxnx1h8EVtlIv+REft/xPRofDxYNP0LDo/d1bL24YOCip1mMmJvNUDHUqO0jDtvotllzgQA2xOnMPdxTlL5Mv+WXGG6gBQQ7wf75CPQB0U8yx4I/jKeJQElrgXxkEaFXJkd3oHxJj87ZmVWC5aN7HdY0/sv2B9fTJw0MCpu8QhxfH+iug0kt4eF/+f3shNAe19mT3Fke4bpw== 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=U7iRm/CSUXDeyXCiUfmTkqapuKQ0tr9/U0yAlV+LZoY=; b=UYEzcxB9nrFo3DwG4KnlaDihSPW+XLYF4e++ZQvRZXHFIroiC5FIp2cOlC+/30QgHZ4hcvNgM/AR6H/RDtFI+iLOlp/30jtn35GMwA9/l7iLjKOqcM8XfhEC4Yuyw1DOxvRRK779lIX7OXonfYPfxZ0t1W81YPdBYwR0RDphKBA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB6302.namprd10.prod.outlook.com (2603:10b6:a03:44e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Wed, 10 Aug 2022 03:41:58 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.020; Wed, 10 Aug 2022 03:41:58 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH 1/4] scsi: Fix passthrough retry counter handling Date: Tue, 9 Aug 2022 22:41:52 -0500 Message-Id: <20220810034155.20744-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220810034155.20744-1-michael.christie@oracle.com> References: <20220810034155.20744-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR17CA0001.namprd17.prod.outlook.com (2603:10b6:610:53::11) 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: fafb2102-799b-4888-1c68-08da7a824749 X-MS-TrafficTypeDiagnostic: SJ0PR10MB6302:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wgGgr0TGW17ij2MnfVSgubJZoCq5j4HDvGlyqqqSXOOTUySScvFTVMlWs5GJdihHqlHxC0sg4t+fALrnmdqh+UeUeS7SJkOZqfZHy3f4iHOHdifn+2C4kOKAsklDjJlSVsiunHgmvEb8+uo5n1SAVtO36qlQkHbAjw3cqrvDvwfuBijx3hEHunqdB2qgFI2TDVJnwBKW8y3478MZ17S7lZpS+YXXsmmmF6m/fpWQb1WRke7jZ/btvPC9BW2gPfAFEapPAbSfO8GT2SIKKY3W2LvRoeANIcZFtKhL39+3y68uP3mvb4pomuVcORFPwR+s5Zh8Zuom4zS6kG9jUoHqz4x5iXaC/3zswno94TsK6QsP4iXRbPJVi4D5Ym5jvA9LncNvz5Zk0BRJRizZ9nQ/NPRQFMEfQ2lJCmEGudiToKHijY6LQWiL/8nNf2/tVCWHrukYDZ/71lPafomLPpac2S8kzmSjLJGg+O8qwBQmhyTJX0B1SUtUUclmZ1tNEifSlg4mZ6UbraRv3hWHJVNIGJR/kMuuATFGDXLso4iyN/nG1nB1fgxieqrAaNrnyfALfLNA8dHaoMOz9VsrHm3zEzcehDgaF+amcVQS9PniPIdwShl7hOx7pcp936WSLK9pOv0BYCEv2xSlcD6HJkzXgduibs5ZoU3F7tE90oc6ADiAr5WPX2ps0MsOZyid2fVQnet17ADcxIZ2u1SMrqcsD2LCrRgguMUet3XqPm9yj7E/RMhUaj7RLSUomTkn2SWA 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:(13230016)(346002)(136003)(376002)(39860400002)(366004)(396003)(2906002)(6506007)(107886003)(316002)(41300700001)(38100700002)(6666004)(86362001)(2616005)(66556008)(6512007)(186003)(1076003)(5660300002)(66476007)(8936002)(83380400001)(66946007)(36756003)(6486002)(4326008)(478600001)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VM3Ao2vmXNV/sMhTeukovoaQGJMIdnHWYO/SbgrGu03I0InhHNYS0CA+d3IBIsxOWD02f+aM/jgBJHARHgK8ttAKmaM4qqACqfSm5A+WXcUlSBxsZKYWudVAwdJRe0zL10wZZTT30gHD+wiNKwCswpksXOBSImwb3a+ZzKscD7vh+ii64dwD1X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Ed28ua14VoihgQ44hzPA+lVJyYyzfB82NVgvs49qSnr61YEGg5vdLVCQmgwFpDeuTDRGaq1FinVS472wyf4NmDHV+RmxFvIxQcgRB7Ew74tSDvJk+z+5sbisKZdeZJG4XhnUhSidgkbnUA8rUMemtkLmGVQjlU7Uhy+sSvlYWSvFznqfZ1uP4TCh3ng9MklC7mDVWFFL5TIh6WB7em9spYOIzoYDAPVleEpkF1/cFQxK8fuJeUYNJBiqIW9HXGuBHUDw218rVx1VqDM42AECYOpqegHqXOH5Q0wz3kG53Y7l0zAuZgVa5Q8H0dx2k6hUA3r3+MRWPgbO4uHDmladMcF40oUyzv84TFEwt3mnZ/bxzw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fafb2102-799b-4888-1c68-08da7a824749 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2022 03:41:58.7751 (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: 8ZEawcSS19hlP90i6j1H3QvMbVd4TlE7PDQAYggPL6X2GYY7OZuZQExrTohfjXV2h0k+tzMpTUJIpRAAyn98BjURImB2sWN5jjB7A06FMNY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB6302 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-10_01,2022-08-09_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208100009 X-Proofpoint-GUID: dgoRCC7va4KlO4bvV2acQTDC4Ej0IAqD X-Proofpoint-ORIG-GUID: dgoRCC7va4KlO4bvV2acQTDC4Ej0IAqD Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Passthrough users will set the scsi_cmnd->allowed value and were expecting up to $allowed retries. The problem is that before: commit 6aded12b10e0 ("scsi: core: Remove struct scsi_request") we used to set the retries on the scsi_request then copy them over to scsi_cmnd->allowed in scsi_setup_scsi_cmnd. With that patch we now set scsi_cmnd->allowed to 0 in scsi_prepare_cmd then for passthrough commands never set it again. This patch adds a check for passthrough commands where if set then we leave the allowed field alone since the submitter already set it. Fixes: 6aded12b10e0 ("scsi: core: Remove struct scsi_request") Signed-off-by: Mike Christie --- drivers/scsi/scsi_lib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 4dbd29ab1dcc..3ef85c8b689d 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1541,8 +1541,10 @@ static blk_status_t scsi_prepare_cmd(struct request *req) scsi_init_command(sdev, cmd); + if (!blk_rq_is_passthrough(req)) + cmd->allowed = 0; + cmd->eh_eflags = 0; - cmd->allowed = 0; cmd->prot_type = 0; cmd->prot_flags = 0; cmd->submitter = 0; From patchwork Wed Aug 10 03:41:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596617 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 8CD3BC19F2D for ; Wed, 10 Aug 2022 03:45:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230225AbiHJDmZ (ORCPT ); Tue, 9 Aug 2022 23:42:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbiHJDmQ (ORCPT ); Tue, 9 Aug 2022 23:42:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5219A72EC8 for ; Tue, 9 Aug 2022 20:42:15 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27A0DqAa026711; Wed, 10 Aug 2022 03:42:04 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-2022-7-12; bh=whgYmqaET0iTljpIS31dMrefVThUKybewn6vHDJS42c=; b=LD0b7nH5JwKYzcTjVmEaZlq1trYcP8t6/mYMnMyIVtWFcLkJR2NgAq91O75R8hA8+JZS ZgibC/P+wXjeHKyPk2SakoR2nIb+NETo6M+0CEbS2dGIxjclGT7d3nHVRlfLkAMC2TuZ hz/Cs6zufOWMEyazB6RkpLmqd34Zdb7cCH4TqBsKNLqFto9LSpKMj6DQcocvk0VcH1WY LiVLdq5EoX5XIo8FspHeugHc2or0CrvSiUDzLINOXCu4v47gVrn9zl6MA7H6smxmrar2 D1i4dsaSNwZ/NXloDVJ2ElCp4hwOwIis18vCx6L4LsxSTmykWVxXATuV3AD8XbL4UaS0 ZQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwq90qwu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Aug 2022 03:42:03 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 279NkcOf038712; Wed, 10 Aug 2022 03:42:03 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2049.outbound.protection.outlook.com [104.47.57.49]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqh90df-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Aug 2022 03:42:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c46vssnhfO0/vUYdRL3TMmxGt36ASs/8hjks6Y7DgaJmNCfNf0M64vy6uYZuyt0ZjKE4b6XcXFyv81czFWZJQhzFnN3YF6Jo3y+K38IBkEdk/k+IRYJFv16J87nZgyuZMB0aAv30e5j5qREBh3WS44h1OC8HRgdSbLptsr9604ZO3R3SFiMaaEvcUu21l860PmGcFZVMiGjJW6JwUwamLvupOkzJCCms7XpH0FNnW5EQwBgQ16aRgul/PmaKRfjVQTARxQXpzpHzAMUHnshxdn6B/gqOKXnNMbmu7bqR9R53LwS9G07wagLGPNu8yLsK7a12mGhPTp1a3EDL+6Wgug== 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=whgYmqaET0iTljpIS31dMrefVThUKybewn6vHDJS42c=; b=hPfViNrvVDu2Kl7A2vaJtaf8oFHcrPnxvgWciJ8o36dyj0kYiSIkj21KXxwgpBYNOc+zIbmpHvdVtTBzOMa3CQJVSI7N/cRFxSsxI7knLyQsdwmhd5ioEsr/q5LIqIXT5IJ/1Y7woyN97s7/tUS5Vs5TtK+8iXCpK1Ktwqfr30QClM1PH6NJqJQgnzElN0ydCJb2RxE+Qc2pHGKy092fPy8aP0dW9oQWCF+85F5uGurUm7M/RcA+eDlUkiQnFdIHyxkNbuV8CeN17G+j6gsQBnML6yMzMxV4iHRAN8YOSFb/Ik+WSL292Z5hgB+ZYSXo+y67MPNzZw7iyIK+JWj7OQ== 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=whgYmqaET0iTljpIS31dMrefVThUKybewn6vHDJS42c=; b=gM4HKuBhgC7QJtD6O5wDB6JRuetbnwh23FAZEmxYAfeVbnObxIRSE+kupqSgEPemcbnZctzCq2lHuWCXI/79qwTIbJIM2klQRGimgem2TkYHmNCApZAjeMOoha4QAleP1s81va4Z1YMlkCR6ox3471d92kpq85e+i0s9s97DOEw= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB6302.namprd10.prod.outlook.com (2603:10b6:a03:44e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Wed, 10 Aug 2022 03:42:00 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.020; Wed, 10 Aug 2022 03:42:00 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH 2/4] scsi: Add new SUBMITTED types for passthrough Date: Tue, 9 Aug 2022 22:41:53 -0500 Message-Id: <20220810034155.20744-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220810034155.20744-1-michael.christie@oracle.com> References: <20220810034155.20744-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR17CA0002.namprd17.prod.outlook.com (2603:10b6:610:53::12) 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: dba0c17d-feda-4f69-9302-08da7a824869 X-MS-TrafficTypeDiagnostic: SJ0PR10MB6302:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zmp4AkQ8aQTSwMQUBqbZiOLfcDeGD5mHiet7uqsYZCV/ZyRHahDl1/qG+gMW92rwYDRcWgrjEBRC/38g0nrEY9x53noKXO/gmie9ionQgBJZgqQKRi7/pIaKXp1MvEY5/cl7Mb2NKK7FqznOsPvWMyzSSsVw1PJeSsE26ftnbaXY6CCcwGP1GiQY9Za/8Suud6NQh8FvXZDLDodv5QjdVKabXTCULccRoodprYss5RsmoNgg/9LyahYZ4ymT6n34ti3x0dm8jLYfP5RJlRJYjF9pn2xqqRsD/q5ODVa8PmVdRPAXAThb0GPC33c6tOzsl6ltPrLlLf7ObUpgdwZvnUc0GmmaoN3e29vy+wjkH4q7Fpuoxc5m63+RaV6k2GjB1Xyt9Gj4D+CBgWivUwlJwh+g6o2GoOi0ILgrgO0jqb36xFlgT9+aiUAJUzxSp1T1GCPr9inQYblKoNDIiwZPIigqDLwieXK7WFScUZxookuGnFCdt1/dQKu9uAyl2ingSxrDchZ6dkWrwvBFmpI/q6HV+fngvJw5vAcpYq/UcF1j4vU09ZOjJp31NODkp1XFhTr68mf6gCvNIPj78Q6bRnm+ZqQUZT9O4zFgoxNtfa1tfpoaDM/F1Me71VlhPj91ZSnpnU3IB0cCQ8pBVI+vvU7/WVEIwDGCkRBPv226qA5mJJe9uz70njOwUWkHcBfl1EMNeyMV8whJxpn+XEcRcmjMoOHNs5VAC33qzx6iBzoZlTBiQU++BpVwDH4f1l3A 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:(13230016)(346002)(136003)(376002)(39860400002)(366004)(396003)(2906002)(6506007)(107886003)(316002)(41300700001)(38100700002)(6666004)(86362001)(2616005)(66556008)(6512007)(186003)(1076003)(5660300002)(66476007)(8936002)(83380400001)(66946007)(36756003)(6486002)(4326008)(478600001)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: V7tlHrP4+0c+tf7VKpRXxvnhucp0eE48I1YklgCrzN5IPaHRIyDMvIG3HNgLk4IA3ltscOgRAZawAZZ/ZUqCipVhIHXvvqdwHDWS+O6E5P6opM4JedI3YehkWOURVx7fWR350LvKox+VCgZBdi3gO/9QjqSXWAX1hj080u36/9bcrra1A6rPmy6vykeuUdV3tq4SrfRw65CZFE0qHoye+pBgDW9mSC0chIJOOPCVtwGefaxNViU2OfCjLp7iD3XBV/WKyEgZlikDC/fZh2J+71QYv4o/JzvLwPQuCS/gOBi8rRDc9qTDO2UxOytVLx5C1PBWqZN9hycQhsp4SGaOUgUu+dURAq8pq77zGq6Xv7jLXJUZEV0iFKnHq6DQxC/R84UlA14ShGosiuoXFrIC6gR9+gjiyzAjt6iLLKdjhTMwY71pAUMKbYth5xUhHYED1TzVaWo/LrRVkDHGNjdZh1FRhDDFftL4julkg3fDj2kOC99+Vjyph9WuxfA8CVx4EMzon7R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DqroXMTnuMV+FK2/78pLRaHgZsRqIA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dba0c17d-feda-4f69-9302-08da7a824869 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2022 03:42:00.6655 (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: kfGtR8kCL9EZhVLQDlNBqsrL+f/uJNF1AYbingrtwOhMWfcI7NE88hMy1NcmY0ql7cphmrTWqqKsOcA6vcOZWbceAyswqkPkCA/ojG0F/xU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB6302 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-10_01,2022-08-09_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208100009 X-Proofpoint-GUID: raXeVXuAjCF4oBk4_AJ0lCC-ABaAB8uF X-Proofpoint-ORIG-GUID: raXeVXuAjCF4oBk4_AJ0lCC-ABaAB8uF Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This adds 2 new SUBMITTED types so we know if a command was queued because of a scsi_execute user vs SG IO/tape/cd. In the next patch we can then handle errors differently based on what submitted the cmd. For scsi_execute we can let the scsi error handler retry like normal if the user has requested retries. And for other users we can fail fast for device errors like is expected by users like SG IO. Signed-off-by: Mike Christie --- drivers/block/pktcdvd.c | 3 ++- drivers/scsi/scsi_bsg.c | 3 ++- drivers/scsi/scsi_error.c | 3 ++- drivers/scsi/scsi_ioctl.c | 6 ++++-- drivers/scsi/scsi_lib.c | 23 ++++++++++++++++------- drivers/scsi/sd.c | 3 ++- drivers/scsi/sg.c | 3 ++- drivers/scsi/sr.c | 3 ++- drivers/scsi/st.c | 5 +++-- drivers/target/target_core_pscsi.c | 5 +++-- include/scsi/scsi_cmnd.h | 5 ++++- 11 files changed, 42 insertions(+), 20 deletions(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 4cea3b08087e..0bc69c56f36b 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -689,7 +689,8 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command * int ret = 0; rq = scsi_alloc_request(q, (cgc->data_direction == CGC_DATA_WRITE) ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0); + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0, + SUBMITTED_BY_BLOCK_PT); if (IS_ERR(rq)) return PTR_ERR(rq); scmd = blk_mq_rq_to_pdu(rq); diff --git a/drivers/scsi/scsi_bsg.c b/drivers/scsi/scsi_bsg.c index 96ee35256a16..2d4ae1383892 100644 --- a/drivers/scsi/scsi_bsg.c +++ b/drivers/scsi/scsi_bsg.c @@ -26,7 +26,8 @@ static int scsi_bsg_sg_io_fn(struct request_queue *q, struct sg_io_v4 *hdr, } rq = scsi_alloc_request(q, hdr->dout_xfer_len ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0); + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0, + SUBMITTED_BY_BLOCK_PT); if (IS_ERR(rq)) return PTR_ERR(rq); rq->timeout = timeout; diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 448748e3fba5..ac4471e33a9c 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2025,7 +2025,8 @@ static void scsi_eh_lock_door(struct scsi_device *sdev) struct scsi_cmnd *scmd; struct request *req; - req = scsi_alloc_request(sdev->request_queue, REQ_OP_DRV_IN, 0); + req = scsi_alloc_request(sdev->request_queue, REQ_OP_DRV_IN, 0, + SUBMITTED_BY_BLOCK_PT); if (IS_ERR(req)) return; scmd = blk_mq_rq_to_pdu(req); diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 729e309e6034..d8bb638f835d 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -435,7 +435,8 @@ static int sg_io(struct scsi_device *sdev, struct sg_io_hdr *hdr, fmode_t mode) at_head = 1; rq = scsi_alloc_request(sdev->request_queue, writing ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0); + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0, + SUBMITTED_BY_BLOCK_PT); if (IS_ERR(rq)) return PTR_ERR(rq); scmd = blk_mq_rq_to_pdu(rq); @@ -546,7 +547,8 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode, } - rq = scsi_alloc_request(q, in_len ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0); + rq = scsi_alloc_request(q, in_len ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0, + SUBMITTED_BY_BLOCK_PT); if (IS_ERR(rq)) { err = PTR_ERR(rq); goto error_free_buffer; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 3ef85c8b689d..c689c28d6181 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -210,9 +210,10 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, int ret; req = scsi_alloc_request(sdev->request_queue, - data_direction == DMA_TO_DEVICE ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, - rq_flags & RQF_PM ? BLK_MQ_REQ_PM : 0); + data_direction == DMA_TO_DEVICE ? + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, + rq_flags & RQF_PM ? BLK_MQ_REQ_PM : 0, + SUBMITTED_BY_SCSI_EXEC); if (IS_ERR(req)) return PTR_ERR(req); @@ -226,6 +227,7 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, scmd->cmd_len = COMMAND_SIZE(cmd[0]); memcpy(scmd->cmnd, cmd, scmd->cmd_len); scmd->allowed = retries; + scmd->submitter = SUBMITTED_BY_SCSI_EXEC; req->timeout = timeout; req->cmd_flags |= flags; req->rq_flags |= rq_flags | RQF_QUIET; @@ -1119,13 +1121,18 @@ static void scsi_initialize_rq(struct request *rq) } struct request *scsi_alloc_request(struct request_queue *q, blk_opf_t opf, - blk_mq_req_flags_t flags) + blk_mq_req_flags_t flags, + enum scsi_cmnd_submitter submitter) { + struct scsi_cmnd *cmd; struct request *rq; rq = blk_mq_alloc_request(q, opf, flags); if (!IS_ERR(rq)) scsi_initialize_rq(rq); + + cmd = blk_mq_rq_to_pdu(rq); + cmd->submitter = submitter; return rq; } EXPORT_SYMBOL_GPL(scsi_alloc_request); @@ -1541,13 +1548,14 @@ static blk_status_t scsi_prepare_cmd(struct request *req) scsi_init_command(sdev, cmd); - if (!blk_rq_is_passthrough(req)) + if (!blk_rq_is_passthrough(req)) { cmd->allowed = 0; + cmd->submitter = SUBMITTED_BY_BLOCK_LAYER; + } cmd->eh_eflags = 0; cmd->prot_type = 0; cmd->prot_flags = 0; - cmd->submitter = 0; memset(&cmd->sdb, 0, sizeof(cmd->sdb)); cmd->underflow = 0; cmd->transfersize = 0; @@ -1605,6 +1613,8 @@ static void scsi_done_internal(struct scsi_cmnd *cmd, bool complete_directly) switch (cmd->submitter) { case SUBMITTED_BY_BLOCK_LAYER: + case SUBMITTED_BY_SCSI_EXEC: + case SUBMITTED_BY_BLOCK_PT: break; case SUBMITTED_BY_SCSI_ERROR_HANDLER: return scsi_eh_done(cmd); @@ -1741,7 +1751,6 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, scsi_set_resid(cmd, 0); memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); - cmd->submitter = SUBMITTED_BY_BLOCK_LAYER; blk_mq_start_request(req); reason = scsi_dispatch_cmd(cmd); diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 8f79fa6318fe..550df58f228a 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3637,7 +3637,8 @@ static int sd_submit_start(struct scsi_disk *sdkp, u8 cmd[], u8 cmd_len) struct request *req; struct scsi_cmnd *scmd; - req = scsi_alloc_request(q, REQ_OP_DRV_IN, BLK_MQ_REQ_PM); + req = scsi_alloc_request(q, REQ_OP_DRV_IN, BLK_MQ_REQ_PM, + SUBMITTED_BY_BLOCK_PT); if (IS_ERR(req)) return PTR_ERR(req); diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 340b050ad28d..3f10cedf6f03 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1744,7 +1744,8 @@ sg_start_req(Sg_request *srp, unsigned char *cmd) * not expect an EWOULDBLOCK from this condition. */ rq = scsi_alloc_request(q, hp->dxfer_direction == SG_DXFER_TO_DEV ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0); + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0, + SUBMITTED_BY_BLOCK_PT); if (IS_ERR(rq)) return PTR_ERR(rq); scmd = blk_mq_rq_to_pdu(rq); diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index a278b739d0c5..8b9f44079aa6 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -933,7 +933,8 @@ static int sr_read_cdda_bpc(struct cdrom_device_info *cdi, void __user *ubuf, struct bio *bio; int ret; - rq = scsi_alloc_request(disk->queue, REQ_OP_DRV_IN, 0); + rq = scsi_alloc_request(disk->queue, REQ_OP_DRV_IN, 0, + SUBMITTED_BY_BLOCK_PT); if (IS_ERR(rq)) return PTR_ERR(rq); scmd = blk_mq_rq_to_pdu(rq); diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 850172a2b8f1..b981a186e195 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -545,8 +545,9 @@ static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd, struct scsi_cmnd *scmd; req = scsi_alloc_request(SRpnt->stp->device->request_queue, - data_direction == DMA_TO_DEVICE ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0); + data_direction == DMA_TO_DEVICE ? + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0, + SUBMITTED_BY_BLOCK_PT); if (IS_ERR(req)) return PTR_ERR(req); scmd = blk_mq_rq_to_pdu(req); diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index e6a967ddc08c..a5886ddcf075 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -941,8 +941,9 @@ pscsi_execute_cmd(struct se_cmd *cmd) sense_reason_t ret; req = scsi_alloc_request(pdv->pdv_sd->request_queue, - cmd->data_direction == DMA_TO_DEVICE ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0); + cmd->data_direction == DMA_TO_DEVICE ? + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0, + SUBMITTED_BY_BLOCK_PT); if (IS_ERR(req)) return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index bac55decf900..1ade0d454874 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -63,6 +63,8 @@ enum scsi_cmnd_submitter { SUBMITTED_BY_BLOCK_LAYER = 0, SUBMITTED_BY_SCSI_ERROR_HANDLER = 1, SUBMITTED_BY_SCSI_RESET_IOCTL = 2, + SUBMITTED_BY_SCSI_EXEC = 3, + SUBMITTED_BY_BLOCK_PT = 4, } __packed; struct scsi_cmnd { @@ -387,6 +389,7 @@ extern void scsi_build_sense(struct scsi_cmnd *scmd, int desc, u8 key, u8 asc, u8 ascq); struct request *scsi_alloc_request(struct request_queue *q, blk_opf_t opf, - blk_mq_req_flags_t flags); + blk_mq_req_flags_t flags, + enum scsi_cmnd_submitter submitter); #endif /* _SCSI_SCSI_CMND_H */ From patchwork Wed Aug 10 03:41:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596616 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 08197C25B0D for ; Wed, 10 Aug 2022 03:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbiHJDmY (ORCPT ); Tue, 9 Aug 2022 23:42:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230191AbiHJDmQ (ORCPT ); Tue, 9 Aug 2022 23:42:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF85D72ED1 for ; Tue, 9 Aug 2022 20:42:15 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27A0E0iP020982; Wed, 10 Aug 2022 03:42:04 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-2022-7-12; bh=/Xf8/cKA6vArGcZuHUkek+fKsIFfm0tHR2Eh0qreAng=; b=beB0CIYcPNRD0/Pj54eTAcCH9Db8yxv+qvHM91KNTXYI80fZXFI2RwNN15TdrF57Mbcw lXehPszFd/s8YDId3tHLTgSJqKLX9kzZ9RHCETVW6BzKywjCdE8416U1SArRTdRzPxxt 5o3cKcSyKu1nYSG2PAT/KIRRRDyuXpFGgu0BMkE2FoubDtKH98WfyD1ChauxzilAU68K xOQWz6lxTCXC/L9Mjf6OmfnsriqpdX2/K1t8tcJd4INC+tvQ8XDBtke5aZ26OTiLlSqp xxBbRYOG0sfw4mE69sHS5KX97X2OduLAHKSXM9VmnHEZA2oT4kA+ClQhAn7KCrfI5sQ9 mA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwq9gq2s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Aug 2022 03:42:04 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 279NkcOg038712; Wed, 10 Aug 2022 03:42:03 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2049.outbound.protection.outlook.com [104.47.57.49]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqh90df-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Aug 2022 03:42:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IJl7esUz0eaO19PCZYxVyPJiPCyKEBTnjeBzTyaBV8iYGGm/sQNWxXaTWuxTPUWCNbj2e9avEB3EDsZj2tDa7NCUhbNgf1MBxgkF+LULvbBLtvONNNnkRqXKgqfcvhaOnU1s0ACNdY/9BZxi34NVcMeNYVjOUQGrGCeGqpTX4rBVGEJ7DFW/EF0AxbXUuZbFpppsrmcjYJUDL3oSNhSZKLoTZHiZPuMsUEPmOd1KmtSEX2pZXQ8/jY20suODQf432eYwY3rgalkL0mVD130+ylm7nrmnbirE4h2gZYbT0KQLPQsPp1Ecgul7xOJ48bFTmFpOi3pm9+CPgevrYZ+ZZw== 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=/Xf8/cKA6vArGcZuHUkek+fKsIFfm0tHR2Eh0qreAng=; b=ToMTVOghpY0PduukgsJzpaP8nHOZtqB2t+WtJjNXC2smg3vWU1e482/TqaerQrwfLi5sgVFOn6pxMgPGgiVO00jqr0Urt2YLh/0uLtSb1eK+2VSBHFmf1JwlWY8bScUTYTNupkvN2zUZ6t+u9K2tI8mE99ouask1hUrhEnhgoL9gqwOAD/uzEIS8ueuVxRTvxLgjjQuhC+wfZDCbtlOG//qt7QB9Y8x3wrEBUckALjLFF6sFDo2/crDIV0bNfu9ip3o6fJuYt+ispcK1AdGMR6Gdeo8LrwOGPLyCVgNnwG4plbYBqi9FXt9l1E73uoVBtKiDL32l1gBCPcUjXT1uag== 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=/Xf8/cKA6vArGcZuHUkek+fKsIFfm0tHR2Eh0qreAng=; b=k5fZkpljw/3IJIwaYu3tXCgxtwxTXBzo3wHJ4Q3gX2JT9xqoaz+PilhYcz2YzNYLLB4kU12t3HSGmFjV13p2tLEmFwwbUCOvpEfit7q4MmG8aaCYAVF1yZaoERT5qoCiNktOZRYfDDg5TTp8e2/R4ySF0qklJFBOOY2BVAGP4eM= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB6302.namprd10.prod.outlook.com (2603:10b6:a03:44e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Wed, 10 Aug 2022 03:42:02 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.020; Wed, 10 Aug 2022 03:42:02 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH 3/4] scsi: Internally retry scsi_execute commands Date: Tue, 9 Aug 2022 22:41:54 -0500 Message-Id: <20220810034155.20744-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220810034155.20744-1-michael.christie@oracle.com> References: <20220810034155.20744-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0P220CA0005.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::8) 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: da3df589-e0a8-4b9a-5b91-08da7a82495a X-MS-TrafficTypeDiagnostic: SJ0PR10MB6302:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9lBOAdY5yAiZlPORyDw6ImCJ3tJqXxrEBwS1uuDRP6KlMksR1VaKRD0QA2uWQX2Ye09MEvV4X3VnvtzW3w1m8mbqW+5u7kgMg9hEnUBkhTqtDsftUKOez/mWLZ4BiXcIF0WMzITrh6O+uNhupw7+70Q6PDbAjlACejx0SV3py88oG2b0wNg61ARdZsLYrp2zPntSrgn7FyMMv/Pz3bX3507Z2XDW5HZ/IY3tqlaeqWxhl1z8JmcZosNTqCbYxqm3MxQDQTMmKd0EInVyoKQhgklKtgEQZigZUBe06Hq87YO5CSAZPdtsuCY/2euTyRDfX19DmmG0PB+jeRiH5JZGtQL8l+3ayNGI2Qg9vIPgvz6yr8jufAP1tvCZ8iMNKwS96L05dUqJWlrGiDM8Ey9RITuEawd4SyoNhZkHj378xJ2H+Ccfyglk++i7zNUL7g1xtIPFqkK35QG0ZEWwiEV9P/jgvrqO9O5OGmNgIzpQwsenaPuZunZTpgbhCL+3i2aosKk1b5dOwyY4W8lLzpX28ob/WbR3ki1C8Vo8m8fFGxfF7RNBMdaaXobPSjiwM8AuY5liLiwZVS5uQoPq0qJcoMbjpDq3RZ6m3g+27blriWmQFQ3GddB+xnurRAIPpjzvE69gfbVRMZp6D/2/dqJEh/iB+ZppbPgCeazxQj7Gbx43jmWY+Rilmtvl1OzE0YWZunAHHiOBEqGXnBaOZBTGA8c6d/2kSHAllPKwqkoMbGWFgHDR1NVKPG0YjGpXtlDZ 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:(13230016)(346002)(136003)(376002)(39860400002)(366004)(396003)(2906002)(6506007)(107886003)(316002)(41300700001)(38100700002)(6666004)(86362001)(2616005)(66556008)(6512007)(186003)(1076003)(5660300002)(66476007)(8936002)(83380400001)(66946007)(36756003)(6486002)(4326008)(478600001)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-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PybpZTzfVR4yDIHbUxfF3Wp0UymH70WfxowDcAzKHDifFZkm7F13i2h4EAOTsgDAmwle/3UEau05ueCyeL26HLijyDks5eVMdZg4Fht8H7obDBBicuMmvBN3LIHTJhotKtrNlACEUw6xa3G4QiDtARkAJWB44wJ1sCMBFcwPj1vWGziN5p4T5KQRhh1rHcpX2CFAIM6KHm+DPQl1vpKjn2uXYwRb8Pwv/986X03Yy4FNsVAbxISlEdZXrtSa93KpmornhF/SpjdsotpIo/iA10myj/O1o580n8yjPurpuZCrHxZpb2A/ApBwCcr2gJVeWBapzupxccWnn0U951KMvqJyVA/fP/vQWO7NJCjRz1XBYaN16oaaUAuTWIV79VhxAEgS/aKuHshCZj55qdMtluV5bNyMfgvkPnziV6yVCuyHWJQqJD2pcKhFvrwBpPURGPL1c2rus3vSAk/jSwYBZVm+gc5FP6oJ2siKfeyatPWvBAND3d+I+yK1WAC90ojbr3pWYu9sZeBm3IDHeDzWJtp9V61KXUiIReNiEpyzsc4NIateg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: da3df589-e0a8-4b9a-5b91-08da7a82495a X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2022 03:42:02.2591 (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: G5iBw4a1VL24Jo/cv45xHKmsrEqfWQX5JI1YWlVnT9LV58CzM2e4y01eXZxfxPWeOReLHH7XBsOwchI1mIrWTdKO9JqVw6RtdjaYFbDqQDQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB6302 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-10_01,2022-08-09_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208100009 X-Proofpoint-ORIG-GUID: uTq65bXTH3u1P3XJrP-UMEtwEuskR4gs X-Proofpoint-GUID: uTq65bXTH3u1P3XJrP-UMEtwEuskR4gs Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In several places like LU setup and pr_ops we will hit the noretry code path because we do not retry any passthrough commands that hit device errors even though scsi-ml thinks the command is retryable. This has us only fast fail commands that hit device errors that have been submitted through the block layer directly and not via scsi_execute. This allows SG IO and other users to continue to get fast failures and all device errors returned to them, and scsi_execute users will get their retries they had requested. Signed-off-by: Mike Christie --- drivers/scsi/scsi_error.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index ac4471e33a9c..573d926220c4 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1806,7 +1806,8 @@ bool scsi_noretry_cmd(struct scsi_cmnd *scmd) * assume caller has checked sense and determined * the check condition was retryable. */ - if (req->cmd_flags & REQ_FAILFAST_DEV || blk_rq_is_passthrough(req)) + if (req->cmd_flags & REQ_FAILFAST_DEV || + scmd->submitter == SUBMITTED_BY_BLOCK_PT) return true; return false; From patchwork Wed Aug 10 03:41:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 596615 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 55AA6C25B0E for ; Wed, 10 Aug 2022 03:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230227AbiHJDm0 (ORCPT ); Tue, 9 Aug 2022 23:42:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230192AbiHJDmT (ORCPT ); Tue, 9 Aug 2022 23:42:19 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF89572EC8 for ; Tue, 9 Aug 2022 20:42:17 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27A0E8W8026805; Wed, 10 Aug 2022 03:42:06 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-2022-7-12; bh=gLkPC/Ecbzr7wVrNZUeNecZyWUXAFk+TI7XUTcb6cRU=; b=RrW+0HrXACFzwAuM2P+VV//mPLH4tJvsijXLwjIGOnGZfAHgLzamktQOKzjPK0x3f0xc Ce+bIIw6xcQcrEXWlXsQTifqtKtjYvGyANfmSZX+gEfBEjQPvCZm34I5a8Dq1PPcKIk4 F48gHxIT7r3TVwQSxFfGbWnL9huH6BfbTATXLW10dzykE6fwcQZ+HL88jgtF5MuebuMJ ZqgE1XOQDpROM3flgxuFZbP897fxMOQ6ykmUZSUAOW1c0n78tTt8e1CyaDoCKOUG92+t 3uR3sy6KBDZQmvYfhwBCzksk5rhwVvXIrvevVYCviLS1wLa2BGQKVkxbkc0irezQ7xzB Dg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3huwqbgqwt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Aug 2022 03:42:06 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27A0dPNP019955; Wed, 10 Aug 2022 03:42:05 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2042.outbound.protection.outlook.com [104.47.57.42]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3huwqhrx74-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Aug 2022 03:42:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U99mm1dzUYdwgf6JnDzGYetGTto30PlJXVre74QWA+QLDN8EF1WxdbRmgBop4grgTWkzqgJPXE2SAi2qQPsOHDtQRTP8CDpF6cn6KHfX78GdG+87KDhNS6KTRPB+Tgw6PItRabiYf7eqkxP0wjmQEveU0eWqKTYM25bP7qyFn4pNK4AhmPS3Gh40n4FDafalBFVh8x/RatDZw848Y7m6Xd8vBC6PhUlTmYPBRrO4n7b5+43FN+p7ZaaI1xzNHanI4kaquaREUFfGGS8d1QBGCu72oVJS/LlHygCMUywTo1+NOWo+uEsf29voShD8pfuatSqMgS7CLsb8cu5tc6Htjg== 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=gLkPC/Ecbzr7wVrNZUeNecZyWUXAFk+TI7XUTcb6cRU=; b=Ju4oy1/9t87VsvzkTd9oi+VvuqQWrd/ZklyXLIeh17znT14GKL+mjBzHXMe2fkrKeRwA6fLcP/vktAIfuB/3wBaaG1rtb3rK6cu77SnAem2yBkWUf1Vn29Gd3O6t/WUKmWOiJyGxxjFM6v6pdbbOeJb/s8dJHKWD2n/8CCgIKnj3aKgOQZLPmrVFAKNomZgfMoY950vjrX7WYNVKLQPcnDJOYqVfJH5FqgvZXdfmDlvepAoG9v414UVRNLqzYgYr+2KpK1viZLYMCXBnvCnlSSvK5qr5H+8d5MJA1rNE1ooIssqKuWWRSC85mUneD2ORG8O2P4E1jpJTd7mW3PJ+/w== 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=gLkPC/Ecbzr7wVrNZUeNecZyWUXAFk+TI7XUTcb6cRU=; b=a5QQuacjGtNM6lIQBmzGjzkhU1G8Taws8dmO1xnrAlPy18CkoEPvPiQEp1Qh069vGnV3ey/72C4hH5wGi4pZ6ikwGiIJAQCTSLluoetkBozGRsCUHyRh6N3ityDxVIJGhnRcaZO2LLzPHJCQovhkn7BAC8OVHWvJiYacr2AahFo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by SJ0PR10MB6302.namprd10.prod.outlook.com (2603:10b6:a03:44e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Wed, 10 Aug 2022 03:42:03 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::8dee:d667:f326:1d50%6]) with mapi id 15.20.5504.020; Wed, 10 Aug 2022 03:42:03 +0000 From: Mike Christie To: bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH 4/4] scsi: Handle UAs for pr_ops Date: Tue, 9 Aug 2022 22:41:55 -0500 Message-Id: <20220810034155.20744-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220810034155.20744-1-michael.christie@oracle.com> References: <20220810034155.20744-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0200.namprd03.prod.outlook.com (2603:10b6:610:e4::25) 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: 2ce7aa9d-4be7-4132-c3dd-08da7a824a29 X-MS-TrafficTypeDiagnostic: SJ0PR10MB6302:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q+S97i8y5iWgPJR97C4E/zATgK0yBUTWOuwKhm91/EFIO1hLrRxmbfHAV1Bc7AOE62xam/vfpkV3rExwSBoW3EPQzg7aYBNWQ7AUHyt/63VMa4XVdm9dISlfV5weurdAoua8oRU/7AuNe4RAUgzD/N3tmNs1hMc35CiCmi8uL14x24kN6HB2U4772WQzuLio1te3TGE9HZY4vtMahKOOUKygSpVwRAMqOV1tVijRYlGkjcidOm4xeMXMLoVJeZKHlUkba8BNyVbqKtQfs73tAJde17xFhaQ5zmGW85tUJ/WnVzepjnkJE9IZBIe6dXcyuFMykVgL9/6AuJXudix7CUABNVNSZQ1UpV9xU1D8wlrQdUXDJwa8wr/G0AEl0M4JXH7YLQKlI+PHN47DcT05RHw+IKMfyx9ETrDsv1becrc/sRk046Rn+dyM1kBXDUSVPg+rJIgj9cfPnIcBexAJG8y3x6A+DuFHwsmC4tmGFi6jGbo/YXfXQQirF5t866oIXsBQH6GIHrkRrpairiVvFFZwNiXUh/4Lm3MmIvx1f5oKDJsHTqn0xG9VDABJDQkE3q/kU3LnhBhdmBPFu5jfPFxN+VKiKegQNZe9P+ZrlKJNzLXchPJe6X/NRRPQZ00wyVd8fiN7982SjcqOHMDLMEkhSqh+09I0Ki9A1NkMKn74Zari4G7G1r9R9hP9uiaJ+mcIVWU2o/gz7eYskEb3q5d2cFAPEOaxQxP7wyrmO7gZxiDyVemoIv0+PRE9rV3a 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:(13230016)(346002)(136003)(376002)(39860400002)(366004)(396003)(2906002)(6506007)(107886003)(316002)(41300700001)(38100700002)(6666004)(86362001)(2616005)(66556008)(6512007)(186003)(1076003)(5660300002)(66476007)(8936002)(83380400001)(66946007)(36756003)(6486002)(4326008)(478600001)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 78OY9xzW8Z6Agd76BwZ+ItSo9gTfaKHOnLkDVvc79AjlqjQ2gGBHeC/kAFDkc5AYZ5LGw74e4DLDJCdqhqvX+jUAp6ywoF8wKjy/HUkOkvDHRatygg11jTk3HHJQeUQ+XyKheW7PKGyFCLCAvLicnxO/vhkPn8rbub431opmu/aaqEsd+NVLZEufACB0sPLNGTkZfNjCsEzCihl8QAHbhbhncSkQPtYVqF2XB6PveKvh3cgL/ljtnbWllw8ZTfPDdbYW93wrxmEQ/oleF0QFGnySYkjeYQEPCl35ey4O2pLjCuWwzUV55IQzBokCdlatdU0VcrjKLoJO6tJCxjLRAShr0jVv3bcND1EGYAzw0XmSSvdde2FZ0B3rLo2kSVBMbgTlVghu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HKdWyZgA4FoiMM0eoRCSnkn/qcEVkA4i3ouWZ7bi3j0aEjmChO2SkdS5IyFhMOVHvQOrNa1NIYBTqRzshR5Jn+XvP8ma0Tw4kIREVnT0OjWdlB/VHgJtQdI/hgs7J2B8e5riEeONMb1mZ9rgOzTK0HSUw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ce7aa9d-4be7-4132-c3dd-08da7a824a29 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2022 03:42:03.6184 (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: IjaYHOxfCKtnUdCjGJJahqvxbKrAwGMshBHpF0repcj8j4xGOaKvdlwDOX1Ao0g4DCR2A4GG0nvy9zwNkWvbUPbdwqVMFr1H/Nw1u5u5qVc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB6302 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-10_01,2022-08-09_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208100009 X-Proofpoint-GUID: Ijf_fHSwBppAWlITy0MgSf8t4kot70Rs X-Proofpoint-ORIG-GUID: Ijf_fHSwBppAWlITy0MgSf8t4kot70Rs Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org There's several UAs for PGRs that will occur when releasing/preempting reservations. If we get these with the pr_ops right now, we just log a failure and return. For dm-multipath this is a waste because it will end up trying a new path since it doesn't know what a UA is. For userspace it's also a pain, because they end up just retrying. This patch adds the PGR related UAs so scsi-ml just retries for us. Signed-off-by: Mike Christie --- drivers/scsi/scsi_error.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 573d926220c4..59528138328d 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -634,6 +634,14 @@ enum scsi_disposition scsi_check_sense(struct scsi_cmnd *scmd) if (scmd->device->allow_restart && (sshdr.asc == 0x04) && (sshdr.ascq == 0x02)) return FAILED; + /* + * Registration/reservations preempted or reservation + * released. + */ + if (sshdr.asc == 0x2a && + (sshdr.ascq == 0x03 || sshdr.ascq == 0x04 || + sshdr.ascq == 0x05)) + return NEEDS_RETRY; /* * Pass the UA upwards for a determination in the completion * functions.