From patchwork Tue Jan 5 14:25:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 7955361 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 68DC89F38D for ; Tue, 5 Jan 2016 14:25:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70BFE2037F for ; Tue, 5 Jan 2016 14:25:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F34FE2037E for ; Tue, 5 Jan 2016 14:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666AbcAEOZV (ORCPT ); Tue, 5 Jan 2016 09:25:21 -0500 Received: from mail-by2on0074.outbound.protection.outlook.com ([207.46.100.74]:27360 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751614AbcAEOZU (ORCPT ); Tue, 5 Jan 2016 09:25:20 -0500 Received: from CY1PR0201MB0828.namprd02.prod.outlook.com (10.160.142.11) by CY1PR0201MB1865.namprd02.prod.outlook.com (10.163.56.11) with Microsoft SMTP Server (TLS) id 15.1.361.13; Tue, 5 Jan 2016 14:25:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TZ+WZwsm/KLs3AaFQnl8D/eVpdA6yL5uxRq/bZ6Da8Y=; b=uPCtdplUfDZHxqe3kr6Bj179xCuzn3ifoEFYyvRcjGCdkB19JaeZ9n3faxY5HG09Z4OdHy6T/7jUTvvnK/8S6oxDmcoQ/OFsNIEsrCqR8c7DrZBG16XOPR+XG3I3O620emMMqw0vdbQcj6pdh9u4Dg0IdgW9g3BoAaODAS90op0= Received: from CY1PR0201CA0028.namprd02.prod.outlook.com (10.163.30.166) by CY1PR0201MB0828.namprd02.prod.outlook.com (10.160.142.11) with Microsoft SMTP Server (TLS) id 15.1.361.13; Tue, 5 Jan 2016 14:25:16 +0000 Received: from BL2FFO11OLC003.protection.gbl (2a01:111:f400:7c09::100) by CY1PR0201CA0028.outlook.office365.com (2a01:111:e400:58b9::38) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Tue, 5 Jan 2016 14:25:16 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.173) by BL2FFO11OLC003.mail.protection.outlook.com (10.173.161.187) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Tue, 5 Jan 2016 14:25:15 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id F1.1E.02821.B42DB865; Tue, 5 Jan 2016 06:25:15 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.248.2; Tue, 5 Jan 2016 06:25:16 -0800 X-AuditID: ac160a69-f797e6d000000b05-fd-568bd24b4d30 Received: from [10.50.231.71] ( [10.177.8.100]) by milsmgip11.sandisk.com (Symantec Messaging Gateway) with SMTP id 1E.FD.08831.A42DB865; Tue, 5 Jan 2016 06:25:15 -0800 (PST) Subject: [PATCH 10/15] IB/srpt: Fix srpt_handle_cmd() error paths To: Doug Ledford References: <568BD0FC.70207@sandisk.com> CC: Christoph Hellwig , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <568BD249.1000100@sandisk.com> Date: Tue, 5 Jan 2016 15:25:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <568BD0FC.70207@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHLMWRmVeSWpSXmKPExsWyRoxnka73pe4wg+MX9Cxenv/AarFy9VEm i2eHelkcmD1232xg83i/7yqbx+dNcgHMUVw2Kak5mWWpRfp2CVwZ/w40sRTMFaw48vEpSwNj F18XIyeHhICJxN2fn5ggbDGJC/fWs3UxcnEICZxglHizYisrhLOdUWLJvx9sMB0LuxcwQSQ2 M0qsP/+DGSQhLOAo8eBTFwuILSKgJrHp1SL2LkYOoCINiXdbs0DCzALxEus+vWEEsdkEjCS+ vZ8JVs4roCXx8992sCtYBFQklnS+B4uLCkRI/NiwhBGiRlDi5MwnYHFOAU2J/627wMYzA9nr d+lDjJeX2P52DjPIaRICy1glHr89CHaakIC6xMkl85kmMIrMQjJqFkL7LCTtCxiZVzGK5Wbm FOempxYYGukVJ+alZBZn6yXn525iBMcCV+YOxhWTzA8xCnAwKvHwcrzsChNiTSwrrsw9xCjB wawkwvv6SHeYEG9KYmVValF+fFFpTmrxIUZpDhYlcV7rFrUwIYH0xJLU7NTUgtQimCwTB6dU A2OezJkz51j1uxQWKVzplmpQv32lMmhq2CEbpvCK1I48fo1LJx1zNgfnfC3v3qvlUCOUKHrt qr6S9O0vVw9VZBbt2x8ZuXxmzAzvm13cVUnltu3iM6M/ek/XX7foSKm2YJfLWv9r/yLkvWy7 O97rs/e9iavSP9L89fjWtSl9qXke1dZ6oVc6lViKMxINtZiLihMBpfTk8oECAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCJMWRmVeSWpSXmKPExsXCtZEjRdf7UneYwflXMhYvz39gtVi5+iiT xbNDvSwOzB67bzawebzfd5XN4/MmuQDmKC6blNSczLLUIn27BK6MfweaWArmClYc+fiUpYGx i6+LkZNDQsBEYmH3AiYIW0ziwr31bF2MXBxCAhsZJda1LmUFSQgLOEo8+NTFAmKLCKhJbHq1 iL2LkQOoSEPi3dYsEJNZIF7ibifYGDYBI4lv72eCVfMKaEn8/LcdLM4ioCKxpPM9WFxUIELi x4YljBA1ghInZz4Bi3MKaEr8b93FDmIzC6hL/Jl3iRnClpfY/nYO8wRG/llIWmYhKZuFpGwB I/MqRrHczJzi3PTMAkNDveLEvJTM4my95PzcTYzgcOSM3MH4dKL5IUYmDk6pBkYlI81DuZvY H17LE29svFopxt3kWeWeONXl6m6jh8rr/m2oYrj1vPzHB4alZ4Xu560+ckSw4dYbMw7lZMZD 2XGTomv9V6kXv/dedV9dNN5fc5ngy/8vFVdynnM7dqNv1y+lQ6ovXXbOUA9wCzhUV3Uz7+CP ooZL1ovbfl9lmH68svLjp+larDpKLMUZiYZazEXFiQC2/BUn9wEAAA== X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC003; 1:j/BbFioYQQH0qDDpchZDcCFezxV4gDXW/fWQQqycZEdgJ4h6nwSYBkgwmTBBCKSeq6MQVsfwevMf0HiyVuRJeKBvZUSnra37cSuWtpiO9hfAhKISiD+80UYKG3CwEqkhq6Te18LZhdF1SNv7uZNFP7ilciT3TNfAmGdrfltxGH4nli4mo6TDNb9MU6pqQMATKfEoqvrrfVdhK+56ExWRWEIJCPIjI0FEMhtKDk3tuTnZTQJX8kxe/Wc3WiuKKpOmF/VPhuD90QAigrKhK3hS1RuwJlxyGJkTBmvQbSX37qTi6Qotat4MZzKt68pgbMdjTb+ISQhlysadMR92+hN1FdE3FrdUqN35XRK/y1h1aAQa4BBCypCOjnGXvsLwlKc3 X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(110136002)(54356999)(65956001)(19580395003)(86362001)(4001350100001)(1096002)(586003)(64126003)(65816999)(97736004)(69596002)(47776003)(5001960100002)(87266999)(76176999)(59896002)(50466002)(189998001)(87936001)(1220700001)(50986999)(106466001)(65806001)(5008740100001)(4326007)(230700001)(23676002)(83506001)(92566002)(19580405001)(229853001)(77096005)(11100500001)(33656002)(80316001)(81156007)(2950100001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0828; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0828; 2:K8r4/09gmpBDeEtlEmpa4kG0pDd3qyueJFQEqsCDnOb4pPvfqduVVZU4CZUKYZ7Jgm4inoZM0BmA7IoCRZqRDClWOFspV3s9/dIsMsAcQQQtCehJRlGepgQnMtO+3DqpzdcHVcCvUP7BgnEgxgr1hQ==; 3:fFWkjdjJME2hb7Z7mQ51Kqo04vLw7LEXt3IKuHEe8mbNhEg85x/mF7aR30F4ameELLUxvKpGRsIxp3LcfU3Skcqe8fEtzBy3osWbIBmS5qYmKl3i9nvXxFznVGvkVUPvp1ItkXB9X0D7938TDS9EVTaXNg85qti747iqXhSHWiDcewHEkAI4As+D9zJqRYbDTrhoueuK2WmQL4wvydjXXdEUl330rt9q/SLo6iSB2Q2U5fTodFSju2pWdprDCzeai+rL5+3CQPC6Qn1M3IU1og==; 25:Ww1JZTHX842bBuFpq2cRzvPib/4WMegrBlena/vGKZOQZCzBlkx3oV+bTCZ5n2yWuFDluu7vqJG93jQlAAAlMrB469XYGYMqng88OnNiO6qhMBJCgVZ4pd+LjBCviPL4NvSaU1CcIKym3ca4xWnck6MT/VVeFseXirZH2CWjlyH7aYW/0J7JOd3SPXxxsmu6E7oR4YDvbPA0E3gazOa2autTX9AkyDcH6+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trPw0C7U3END5 H/n6yAvd8lyqeoKkwkoHslb3yBXX X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(10201501046)(3002001); SRVR:CY1PR0201MB0828; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0828; X-Forefront-PRVS: 0812095267 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjAyMDFNQjA4Mjg7MjM6bnpPUWJWVlBUcWNQeGZBVHpmdkJISGpD?= =?utf-8?B?VUZuUVM3Zm1ucSt3dzdMaytwbnpGYysxQzEzbzVTUSsyTjZ0SEEzTkd0YUo2?= =?utf-8?B?aDRweHNYUVBDSmV3T0tKcWxRLysxUzhoOGx2bFRRN1VJZlk4UE5yWnB2WjMx?= =?utf-8?B?dW1pV3c1bTlQTjBEU1dTc09ZUVpaUmI4TUZmU0JxbU5jVzYwTG8wM20yT2Fn?= =?utf-8?B?SWYzekhQQ1FKZTdBaFdSdExobHpCb3pvdGhnb0FUUzdLekdGYVVIVkVUODR0?= =?utf-8?B?OUZSNFYrREZFVXVuaUt3Wk5GZnNETDVJZElnclBzaXhub3BmRHR3SEFwYi9T?= =?utf-8?B?VWwxZ3BTZ2c0Q3R1eXd0NnYxVjZmMUtzQ3lUU2ZUOEhiRXJsa3hCVTlxOHJu?= =?utf-8?B?MjlVM3ZtekdGNXYweFJPNUUwQ0RQZVpJVFBrUDFBUmEwQkVQdTJ6M0RZR2tq?= =?utf-8?B?TENrb3hDZ2NqRm56MnVORTJCZHlmZWdZVEFuSkdSbDc0NmNkbTU0dnBUcElY?= =?utf-8?B?Yk1QRWpOTzdVTU9ZVUNaL0M1d01TNkVyaGUwTjU3Z1h2d3VsOGVacndIaENk?= =?utf-8?B?eHlnWjlhZGZ1MnorSndmaExJYkpjS01ibmxqZDZqZWJkWjJ4V3V4R094elIw?= =?utf-8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Z?= =?utf-8?Q?SAq?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0828; 5:xxp8+uyVzuDtS+U7KE0MR0/X2UbVYxOnEeDgOQa+KOE0fqWxs5e1UPyOe1fD/zgVO9Lrn8Ajq7YRHz8tLQpz4UW4q2F+MuvDiEfLCtluYbMSwkLwdz3de6qAKOgFvyHAJaLTDLbXw+kJ1Y9UZV3lxw==; 24:+SBXZqWDlUoOAXWwAT1Voc5j+WCl7RBmgN2ZSspjPcjlKoyE9l4jz169pZwEevvYgG73APP4oDBNcdTlel7aoBSS5lPXSOxc2rkkDO3Yzb0=; 20:m3BY3hqQG9yTXqjUsoJMrH8Uc+OyHBiE0/FsQvbIniqAeHSVUEpQRwXjGJ18AqFrAmYZZVJD2WznN1E988IArOmRFmOK7acAVSWuh+JBFN/8B8P8DyQB/iu8/wX2wSlWHNt37YD65Zsfg+OTa+BcCSe7TTACSBVURQKWQCehYqRTB56yplMRsva8JUln63Vd5GKnWIi1XSsK4BtZiOvlj9eC6dZUrPRtkzmbaQsP+PsudNzrzTtylQJG1wuezIny SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2016 14:25:15.7589 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.173]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB0828 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1865; 2:bD5RlJ1fpFze9CaEGrbwRETrsrJezLbTav8oiGNCjAdhbqahxnlStN/DbpcRizZTg4yyjTTI6WIOqK+ljtzdcET/eZxh0VLsJrJINCzx6wCNzbK+iZUySumXcx3yi2rdHkzpkEUXbohDGGjvT2mIjA==; 23:1FVVzo7a16sp5EtFiCEI5NjhQ+0mkjD4kEEKq35gWNtg94C+VU2ld9qzu0HDB9Ew4bWpO//J2k/qrzgezGTBnPFa9KoEnkn/siV3vxNHeL54Esg48gLEfSl/VUYYFpL1aqd0N9F9GWSkNu1F8ScbzCPw8viAdUUfsU3kMKLI7PicNaO4WHkq4S6IXJCSGXHf X-OriginatorOrg: sandisk.com Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The target core function that should be called if target_submit_cmd() fails is target_put_sess_cmd(). Additionally, change the return type of srpt_handle_cmd() from int into void. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Reviewed-by: Christoph Hellwig --- drivers/infiniband/ulp/srpt/ib_srpt.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 1857d17..395bc1b 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -1482,15 +1482,14 @@ static int srpt_check_stop_free(struct se_cmd *cmd) /** * srpt_handle_cmd() - Process SRP_CMD. */ -static int srpt_handle_cmd(struct srpt_rdma_ch *ch, - struct srpt_recv_ioctx *recv_ioctx, - struct srpt_send_ioctx *send_ioctx) +static void srpt_handle_cmd(struct srpt_rdma_ch *ch, + struct srpt_recv_ioctx *recv_ioctx, + struct srpt_send_ioctx *send_ioctx) { struct se_cmd *cmd; struct srp_cmd *srp_cmd; u64 data_len; enum dma_data_direction dir; - sense_reason_t ret; int rc; BUG_ON(!send_ioctx); @@ -1518,8 +1517,7 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch, if (srpt_get_desc_tbl(send_ioctx, srp_cmd, &dir, &data_len)) { pr_err("0x%llx: parsing SRP descriptor table failed.\n", srp_cmd->tag); - ret = TCM_INVALID_CDB_FIELD; - goto send_sense; + goto put; } rc = target_submit_cmd(cmd, ch->sess, srp_cmd->cdb, @@ -1527,14 +1525,16 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch, scsilun_to_int(&srp_cmd->lun), data_len, TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF); if (rc != 0) { - ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; - goto send_sense; + pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc, + srp_cmd->tag); + goto put; } - return 0; + return; -send_sense: - transport_send_check_condition_and_sense(cmd, ret, 0); - return -1; +put: + send_ioctx->state = SRPT_STATE_DONE; + target_put_sess_cmd(cmd); + return; } static int srp_tmr_to_tcm(int fn)