From patchwork Fri Jan 29 23:15:34 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: 8168601 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 3D934BEEE5 for ; Fri, 29 Jan 2016 23:15:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C54720256 for ; Fri, 29 Jan 2016 23:15:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2769220253 for ; Fri, 29 Jan 2016 23:15:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753821AbcA2XPj (ORCPT ); Fri, 29 Jan 2016 18:15:39 -0500 Received: from mail-by2on0064.outbound.protection.outlook.com ([207.46.100.64]:23568 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753678AbcA2XPi (ORCPT ); Fri, 29 Jan 2016 18:15:38 -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=Doqdscq3q+0ku0aEixZv7J6csfg9pKLFdGQmIfMGono=; b=YQR+MbTeM6XyY3oz3HimJZakbAUV9WWPrYu6Dt6ZhZKuHNCvd8dsAbeC8/AyD0f5Y/xos0Yv496Kgl0Rb9EYaz0G0AlUw2NS5s+nRUqJzcHLlsNdJCIjDN+xSzf4+IBLdnGtABelcUbk8WlXffbEI7x62mCWOGuX2mwoXmNpF5g= Received: from BN1PR02CA0034.namprd02.prod.outlook.com (10.141.56.34) by CY1PR0201MB1578.namprd02.prod.outlook.com (10.163.140.13) with Microsoft SMTP Server (TLS) id 15.1.390.13; Fri, 29 Jan 2016 23:15:36 +0000 Received: from BY2FFO11FD005.protection.gbl (2a01:111:f400:7c0c::170) by BN1PR02CA0034.outlook.office365.com (2a01:111:e400:2a::34) with Microsoft SMTP Server (TLS) id 15.1.390.13 via Frontend Transport; Fri, 29 Jan 2016 23:15:36 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.172) 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.172 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.172; helo=milsmgep11.sandisk.com; Received: from milsmgep11.sandisk.com (63.163.107.172) by BY2FFO11FD005.mail.protection.outlook.com (10.1.14.126) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Fri, 29 Jan 2016 23:15:35 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by (Symantec Messaging Gateway) with SMTP id 57.40.29304.792FBA65; Fri, 29 Jan 2016 15:15:35 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.248.2; Fri, 29 Jan 2016 15:15:35 -0800 X-AuditID: ac160a68-f4bff70000007278-76-56abf2974732 Received: from [10.60.52.49] ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 2E.67.02700.692FBA65; Fri, 29 Jan 2016 15:15:35 -0800 (PST) Subject: [PATCH v2 12/22] IB/srpt: Fix srpt_handle_cmd() error paths To: Doug Ledford References: <56ABF16E.7070006@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , "Alex Estrin" , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <56ABF296.7040009@sandisk.com> Date: Fri, 29 Jan 2016 15:15:34 -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: <56ABF16E.7070006@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsWyRoxnke70T6vDDB6vEra48PQ7k8XL8x9Y LVauPspk8exQL4vFjbYHbA6sHov3vGTy2H2zgc3j2fTDTB7v911l8/i8SS6ANYrLJiU1J7Ms tUjfLoEr49ebO4wFt0UqTl15ztjA2CXYxcjJISFgIjHzzF8WEFtIYBOjxLS3dl2MXED2DkaJ K6vWsMMU/Zu7nA0iMYdR4u2mNiaQhLCAi8S1NVfYQGwRATWJTa8WsUNM0pI4d+ELO0gDs8Aq RolNV6+DJdgEjCS+vZ8Jto4XqOjrjKtgNouAqsSdm6/BBokKREgc7uxih6gRlDg58wlYDaeA tsSS2ReAbA6goZoS63fpg4SZBeQltr+dwwyyS0JgL6tE59VjbBBHqEucXDKfaQKj8Cwko2Yh tM9C0r6AkXkVo1huZk5xbnpqgaGhXnFiXkpmcbZecn7uJkZwdHBl7GDcOsn8EKMAB6MSD6/H stVhQqyJZcWVuYcYJTiYlUR4614AhXhTEiurUovy44tKc1KLDzFKc7AoifNat6iFCQmkJ5ak ZqemFqQWwWSZODilGhjbOyfL68fpbb0QuPrSa6fy8j8LrkguuN8j2xhgO9Xsnfb0fp6VyQ/u XnV0ucfZIs2nkN2xc/aKVRWr58dcPP7YXtw29PnlkHt/VnywbDH/Ybc30+ORxaqHKmb7P+y8 tlfo7RTllg37BEt+2W3tjasQdbwpb7G71+aCT9MC+2X7FxYFravZqZymxFKckWioxVxUnAgA udnp5IoCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPJMWRmVeSWpSXmKPExsXCtZEjRXf6p9VhBh/OMFpcePqdyeLl+Q+s FitXH2WyeHaol8XiRtsDNgdWj8V7XjJ57L7ZwObxbPphJo/3+66yeXzeJBfAGsVlk5Kak1mW WqRvl8CV8evNHcaC2yIVp648Z2xg7BLsYuTkkBAwkfg3dzlbFyMXh5DALEaJa5svMIEkhAVc JK6tucIGYosIqElserWIHcQWEtCSOHfhCztIA7PAKkaJ3ys/gBWxCRhJfHs/kwXE5gUq+jrj KpjNIqAqcefma7AaUYEIicOdXewQNYISJ2c+AavhFNCWWDL7ApjNLKAu8WfeJWYIW15i+9s5 zBMY+WYhaZmFpGwWkrIFjMyrGMVyM3OKc9MzCwwN9YoT81Iyi7P1kvNzNzGCg5Qzcgfj04nm hxiZODilGhiDrmj/aZ34r6/+TK269Pepn93u7tD+fti8N//NtZ//xH7Or9Kz0C2NevvnzbYT 9a9/aZakW3q9c+lSXnzbfE1m0D19N6OTt+Seu6xe0hayqaAgRTbtlSvTp3ChZL0E1vZ5BZFT 1tp8ivfi6J+1/tj0ds5XRS3H1KUkr2yJ37R2X8EdgYWfleKVWIozEg21mIuKEwEjME9kAgIA AA== X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD005; 1:N84ToMZSsm+JQ/6q1NtuHjNnqndswLfTd1AHEHUY6m/F0Lax21i2swHauQiu32Cr0HXMjjCdZLOHcm56HHq6sxXewF5q1wc4XQ0EgDX44UJncgjP1UxlLnDa9I1C9gxyWQXq0DGxx+m8MlrBBj/94zpo++xmyYylM8CRJ26VoIZ0IJRdrShhL+WB7NP92X9/+A9nhbfcNBTJyTeVgKBskkCjoACFjRIrfgtixxpdwfcpm6ZyRs68UvJX4sQ0x3+TLU1Qb/A+dl8fLMBF7Vep1vbzcyueo5psuC+CJPDxxn1YuMb1YaHI6y4hkCSeeb+G+KYSNs282U7uvfgp7QxuwSiWUMSLoEJ4X7ZTfgLiOTWLJWBVyMs/xJtFToiM237xhDIRfZAHSzrX1xoB5W8M0jRjemzORY11IxjoGEhnWBwzBF5O7xBh7Nx8pMg58cTj X-Forefront-Antispam-Report: CIP:63.163.107.172; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(23676002)(11100500001)(33656002)(36756003)(64126003)(5008740100001)(586003)(1220700001)(1096002)(4326007)(92566002)(2906002)(54356999)(19580395003)(19580405001)(110136002)(230700001)(80316001)(76176999)(65816999)(87936001)(47776003)(4001350100001)(50466002)(65956001)(2950100001)(86362001)(229853001)(189998001)(77096005)(83506001)(5001960100002)(87266999)(50986999)(65806001)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1578; H:milsmgep11.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 2:L1CFMzWeQMR7Ojysqwm85ph4dJWieLCT+HZZ1HtkcHaV8dEfADPTL0BxnbzD52/9uW6vpvQ2oF1XENecRcDk6aTq+3wrbv5TkLaT9CyAdh5Xh+YvQzaEdd/LgPoTL9i0DgC9D7350cN7zTaMJGShNw==; 3:7rR3zCGPa42cJLGOw4LPEm+BRKSkBVYGhjgFfgPA7l5zB+2uNLbcdaSMQFWZz8Dk/YjgzlF217yOyAOg2NDkE62pQNzB2xnL3c65DMay9YOhnV3pT7TkA6E8zZpGkYu1pBJYAp0mokWtqubP4iSddE7JXizQBErystjwMDQMDabciegXXobalZoAMfOME0uc2CYlv6I3Jx5yWoEWIkCM7+/Yjlnz378Khqs/BlAkiiL/KioRvY1K9863OyK8N6Byw9FPoutobcMzip4OEJEk7g==; 25:7n5us4VSJkkVyrLnHenlDEp+rk8O7YjasyCW+Xyjha/IQvBZjmboWC1rBEtw9KfoypbzWMdVChSXA8xgmUU0cnCjOn0Ol/RccBWYS1Yv1mEkSbyQ8MBHDhOgbHDenj5J5PGd6x4JRj7O1TgcNZzxRzh16rXOF6amdNDwJGb9SWq+cX9kOA7HcK4mABOX5y0yy/QzDfmGnV5oUV9f39m0xH9FlbgmDmj+UPSiHDT7YdBQU5BDGb6dkV0al7tmPq3K X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:CY1PR0201MB1578; X-MS-Office365-Filtering-Correlation-Id: 13325eeb-ee56-4560-20af-08d3290217fa X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 20:fXAXLD6Ol0CNFDi0lB1LhMG/GETSqqdMzniG7+nXQRkGBbTfPs9df17nfpGnE4BUoQ+/F/aLgrTs238UL+DjiFXR1Y5IbOHf4N5ni5hG03Bl49NM2X80uVLDFwvECnmaCax7hhOEy2QHw5yVe7lza8hI2LAo35WMObz8RHFFBoMXOKZEsbS/Na/iF4pMNGjfmXyu6V0yE3BUPdEIuQMKwdDH7a4PiMGU0Gb7/nDcpTlq6XA1LfqHs76ezeoXOswQ8gbTO/JfCtqx09nVAjZk/44vdXPjIvUa6MFt7EiAQwfYn1YhwrQX31QZlD4z0m/cR42D2S052PXzknyDD9Q4qnmtHgNCDbB35SYm9Ti5bZxsZKPTmx2xce4P7uQJYGHhnz5IFJxnHUximPBXfb/4wyoEwkUC7KYchNuQbj7KbGHntA49mOZoi7ktRFMLwHkq/+knnH8X4dnIBa3elOzRXyy5KbAlO7fRKRVtEJ/TEFMW9vp5qqE76W7iN5eOjDig X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(34787635062028)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13024025)(5005006)(13017025)(13015025)(13023025)(8121501046)(10201501046)(3002001); SRVR:CY1PR0201MB1578; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB1578; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 4:L5GMvFXw47WZTUpWR3LLuMXCAzmuAyAhLWNuJww+6Zrmu9OYWDv6IgxgRy4lE7hFzbNUCKlPAV1SXN62BOaSUf+NNZNlSVl0POMeWQA4hC1ZmixQNNUCOpfqTAEaz0Z1PMkJmtCtjzbpX/gmmXbIjfSlIWBcmzpMpjHCK+N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SHExb094ZG5STnpwNERuOGVDaU9q?= =?utf-8?Q?eqx4nlOUIX71A/ptPlzRNrRcKHjD3?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0201MB1578; 5:59WOplBVf0Q1QUU3WDyFy0lJsEV31SW/loQRTu1aGAT77qcnHyVBGdF9cYP8e8ck1ETXGjdOXeKYyhLCRvMvxPogZL5J5AxN7Ta9erjALtjhgZU+01nt/eoJeiDKF3f8Cws0NGUG1N3RWSwJS+OqFQ==; 24:hWUQcWFZRBx87tE3aWn5SxS56yLG1/IESpcl4bGxYxEdbi95pSq0DfxiV9l41jcHU3PE8W0ju/P3ARjnhKC+P1xfTTBSqm1s9mE6nrrXnUU=; 20:5f4y+4PydIqwmAyglWLJQAw3VyoTzdWjk1uQ/OWLemoPv+pvlKMA8w5CRqp4zD8mtWuHvkDKLLUIYnyn6hSQ59oQFmRG589NstuQzZ5s7mCSn4GHLt43IKR3eMuAf5F9ehIwBpyxv06Jmm2oRpL87tjBlqriYHbYr/w5Bz2Q9IobDoe7LKYYYJWd7GMzRsewmMzCkVnNHVIEEczjR7N278B1rIB/N4YpqxAUqBDdPRg9rdXUX9cyRQD6tM7XJbLG SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2016 23:15:35.7845 (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.172]; Helo=[milsmgep11.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1578 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 Cc: Sagi Grimberg 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 eb6f812..8ab431f 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)