From patchwork Thu Feb 11 19:06:55 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: 8284591 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D4080BEEE5 for ; Thu, 11 Feb 2016 19:07:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D4E3C20222 for ; Thu, 11 Feb 2016 19:07:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A014A20121 for ; Thu, 11 Feb 2016 19:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750784AbcBKTG7 (ORCPT ); Thu, 11 Feb 2016 14:06:59 -0500 Received: from mail-by2on0097.outbound.protection.outlook.com ([207.46.100.97]:38144 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750782AbcBKTG6 (ORCPT ); Thu, 11 Feb 2016 14:06:58 -0500 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=lA7TtZ94NveFcWDQFqznIjtZP1hKPBye/uaMwi4JXvE=; b=NvfN2/y+DigJH/rGyRb+TaV7lL1GCbZf4uGstKwSsq+FqcSWskVt6KqJbWckgXQoxFbWCkomTE85dh1oH/oX5PN5LXYI+43Eyl7F/acpKKlARRCTcP+CPL7GEQMauYfPscZS0vP4OfGYSDZLMYrjtpSZHEs703glyQYIDWDy4S8= Received: from BLUPR0201CA0005.namprd02.prod.outlook.com (10.163.116.15) by CY1PR0201MB0825.namprd02.prod.outlook.com (10.160.141.26) with Microsoft SMTP Server (TLS) id 15.1.409.15; Thu, 11 Feb 2016 19:06:57 +0000 Received: from BN1AFFO11FD019.protection.gbl (2a01:111:f400:7c10::146) by BLUPR0201CA0005.outlook.office365.com (2a01:111:e400:52e7::15) with Microsoft SMTP Server (TLS) id 15.1.409.15 via Frontend Transport; Thu, 11 Feb 2016 19:06:56 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.174) smtp.mailfrom=sandisk.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.174 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.174; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.174) by BN1AFFO11FD019.mail.protection.outlook.com (10.58.52.79) with Microsoft SMTP Server id 15.1.415.6 via Frontend Transport; Thu, 11 Feb 2016 19:06:55 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by (Symantec Messaging Gateway) with SMTP id D7.3E.03682.FCBDCB65; Thu, 11 Feb 2016 11:06:55 -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; Thu, 11 Feb 2016 11:06:55 -0800 X-AuditID: ac160a69-d37ff70000000e62-db-56bcdbcf95d3 Received: from [10.60.52.49] ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 82.E7.02402.FCBDCB65; Thu, 11 Feb 2016 11:06:55 -0800 (PST) Subject: [PATCH v4 11/21] IB/srpt: Fix srpt_handle_cmd() error paths To: Doug Ledford References: <56BCDAAD.7030906@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , "Alex Estrin" , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <56BCDBCF.4080107@sandisk.com> Date: Thu, 11 Feb 2016 11:06:55 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56BCDAAD.7030906@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsWyRoxnke7523vCDC5dU7O48PQ7k8XL8x9Y LVauPspk8exQL4vFjbYHbA6sHov3vGTy2H2zgc3j2fTDTB7v911l8/i8SS6ANYrLJiU1J7Ms tUjfLoErY9GfB2wF00Qr/m3rZW1gPCDYxcjJISFgIrH28Hb2LkYuDiGBTYwSL97NZYNwdjBK bH/RyQ5TdfNmJzNEYg6jxOYb7UwgCWEBF4k1RxeB2SICahKbXi0CaxAS0JJ43t/PCtLALLCK UWLT1etgCTYBI4lv72eygNi8QEVPZ/Yxg9gsAqoSBxaeARskKhAhcbizix2iRlDi5MwnQPUc HJwC2hIzr0SAmMwCmhLrd+mDVDALyEtsfzsH7DYJgYOsEs9+nmeFuEFd4uSS+UwTGIVnIZk0 C6F9FpL2BYzMqxjFcjNzinPTUwsMjfSKE/NSMouz9ZLzczcxgqODK3MH44pJ5ocYBTgYlXh4 DW7tCRNiTSwrrsw9xCjBwawkwnt/E1CINyWxsiq1KD++qDQntfgQozQHi5I4r3WLWpiQQHpi SWp2ampBahFMlomDU6qBMZNVUFKl9m/Vwm4d9ba5/8Oe6Njov2abvjFDZfa1qW0pgb/as+1r d+gFHmJXW6v0Q3Sb4OUnSsZdiXeevZpRu9V6ziTT+MvvvnsKiZkyNW7bn7+Pzfwdz2NPC1+N c/qbzxy+uVnsud9Wq7gTUeKa1k+vuF9Q0d5VVNnV3hwTe/bXSpnTIWo2SizFGYmGWsxFxYkA WcyAy4oCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHJMWRmVeSWpSXmKPExsXCtZEjRff87T1hBssPiltcePqdyeLl+Q+s FitXH2WyeHaol8XiRtsDNgdWj8V7XjJ57L7ZwObxbPph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dfd3RwmKRtJYmHsEdRBn+e2edFYRGVDdUap4xJWG X-Forefront-Antispam-Report: CIP:63.163.107.174; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(3190300001)(199003)(189002)(4326007)(11100500001)(83506001)(586003)(2906002)(189998001)(65816999)(2950100001)(5008740100001)(47776003)(575784001)(86362001)(4001350100001)(5001960100002)(87936001)(1220700001)(59896002)(1096002)(77096005)(230700001)(19580405001)(80316001)(65806001)(65956001)(36756003)(106466001)(50466002)(33656002)(54356999)(50986999)(92566002)(76176999)(87266999)(64126003)(19580395003)(229853001)(23676002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB0825; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0825; 2:19MANFKuI7M067zPuaGQ3t/RQ0IrP6SUKl0Oxv8Ri9W3lcuHCF5xQaht+Bw2R/TnBO5CnV6zmVlmL1oKJNFFI9bM8xZ5nQTlNT1UTorsxZ0GJaC2TSaWA+joBSTlLqf/bWVXcauehpNOBQxoLL5fcw==; 3:l+0h2INCoSBkIjbQZC7kaE+7mgWnlLkLPnMEnDTugnjBT6Rbry5NTsbaV1sCmmLbJR+MpvSIadH3NnTO8h+c65AobupK8H0aPmYrfZYLTr6ZrElzzW+kTJel3s2aq7EEr+kLnhJweeDlCUv3VD5/ec1Ld6NoaiRqznRZXit99J4zHepSvp4ZL+LN982vjsF4zF1sp/DXAsVcgI5K5jfVZfWiD6oPoDNQgnYnXMUyoE9X5JXPlqk1KNDNkQMnFVV+yMI0SG7Sb/PLW3uLF+tIfg==; 25:hBxZ1Tqz0DrXnj256RRZ9iLUfOdlv42rgraUd06+1t36U1YDmluUVLa/sErNPyLUQ2Fv7mRfVMFIglc9/EpWcJY68qIww3q+FMSl1rRuuhHsOzO+ZP9+l9Jcn3y9VBvBXRAdjIGb/RdzWmGKK3G75i6VF31L3Nw3Bji6Qctdln6IW086BxqNyizvViSqHLEBFQ4r21cpCuVLRNmwl9lqBLTQK00uJYtSdhPLUdJg4bIP5S6f4SvRSrDiMKg18+6NyK37FJJKpbnhpM7XM1YYKStIFCxzt2t3O+e4h5kSzylgTBCdKtSw29+n41QeYuqi X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:CY1PR0201MB0825; X-MS-Office365-Filtering-Correlation-Id: a31300ed-5d0a-4c27-1e6e-08d333168295 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0825; 20:6ccCgSOzHUKpbK9aZljIan4IiIF/w1h+ew9F53j26tpP0VePc/9cB0XGcN4rtwG2Lyoetqlxc2O3sn1NKW77E64TBdI4CtYa3G6DEEpOemFBE6adXG9296z3cTRJEJFFRhAN98P/v6d5x1dLSBsboWH/ZMYmCN0c6pF7r/HLgs4mCjJckT+/t7XHNVi/v5MqCXkLO8lA6Bowap0MhPiSoUU9UtP9bFV6TAC3D/0bCxofTsYvKtv4WP/Qq0ziEWwd6H1ScxG+ynggC38QmGobAa6u9PPR/yhCuiYzJ966UR0AQr9X2gZYfG1c/5H0tOORRdeRGwhfIInhz5zhHh2BkEcJE7dkfeKw26tRrCDZyC2fuN81F6wBMtVyjK/rK9XeFyAC5sZVi3BsfBEcXO0kWhFTqd3c33U/SA/00QxJ+7aN6L1peLCZylIGrkqzRv0k2jjXfihay2usIx9ni92XkC6oAmXK1lZH3xPyyCcjnFPkzEth6u9TFmStHAA2zQMs X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13018025)(13023025)(13015025)(13024025)(8121501046)(5005006)(3002001)(10201501046); SRVR:CY1PR0201MB0825; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB0825; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0825; 4:ktU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VkU0ZDlQeC9JV2ZVZTRyL1E4cXdDSDB3OFFXb3RRMVJERnpTY1NNanBM?= =?utf-8?B?MTg3Um9UTjA0eHZ5Q3J6a25sUnVLeDN4Q1pveUdiMjlJYmVFcWlkNkNValVw?= =?utf-8?B?a1ZKVmdUY1dQeWhrNXgweloxaVc0TGt2VnFwNnJmRmdmM3N3Z0s5T3F5b2Rm?= =?utf-8?Q?vHWGqRJ/RKrI4zVBCiKTsk+MxIQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB0825; 5:FvcE/FT9njb7EI5zUz3YJ2Y1YWT+EUmfbiMtVWhn0qeNAhHIP71VHUqEnbpHag60jzEgnUK7ERuXhPTdJqe1oqZ0ghIDRZrZv4/yxI5HKaU+kNZSRSXNv9xYzvecJdultwFYDGoNT86PmprNRV0vHA==; 24:eVODL5X1owaMZAdygx3XZc982UkxLb0ZcwjXvKiMLoSnU1SQHKqXKVHdm+A9r0SNiSpk5rz6F1UPOQN+Mu0EUPMpWU/5xtR0yV2Ovy0wEKs=; 20:QSZKPqnFfeX1k3iOBY7J8TAOWIXbMfWXKjTPmZl6gZQU8C9XWl3dVATndIUAHoNJdladBTbmtmGN6wDvZwuJtOfEH6H36pw9dB7p0IGcPyjYrRro5upVW/jFn61aBZIAtinKh8bwwGt8fcd5zJNxz1+dO/gC/usv/7zNtk7q+lecgh7hbd3duT7yClgFLKDMsDpuZNIuUAlm2RUIfaQ8+JLLlqfW3pkxrbmj6apOOxny38pRhKu0yTwXTaAWpz3K SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2016 19:06:55.7331 (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.174]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB0825 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.0 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 Reviewed-by: Christoph Hellwig Reviewed-by: Alex Estrin Cc: Sagi Grimberg --- 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 d644606..5b0fbc1 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -91,6 +91,7 @@ MODULE_PARM_DESC(srpt_service_guid, " instead of using the node_guid of the first HCA."); static struct ib_client srpt_client; +static void srpt_release_cmd(struct se_cmd *se_cmd); static void srpt_release_channel(struct srpt_rdma_ch *ch); static int srpt_queue_status(struct se_cmd *cmd); static void srpt_recv_done(struct ib_cq *cq, struct ib_wc *wc); @@ -1492,15 +1493,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); @@ -1528,8 +1528,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 release_ioctx; } rc = target_submit_cmd(cmd, ch->sess, srp_cmd->cdb, @@ -1537,14 +1536,15 @@ 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 release_ioctx; } - return 0; + return; -send_sense: - transport_send_check_condition_and_sense(cmd, ret, 0); - return -1; +release_ioctx: + send_ioctx->state = SRPT_STATE_DONE; + srpt_release_cmd(cmd); } static int srp_tmr_to_tcm(int fn)