From patchwork Thu May 4 22:50:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9712873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C5EFF60387 for ; Thu, 4 May 2017 22:51:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B744F28639 for ; Thu, 4 May 2017 22:51:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC12B286A9; Thu, 4 May 2017 22:51:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D62128639 for ; Thu, 4 May 2017 22:51:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753189AbdEDWvi (ORCPT ); Thu, 4 May 2017 18:51:38 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:32270 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753046AbdEDWvQ (ORCPT ); Thu, 4 May 2017 18:51:16 -0400 X-IronPort-AV: E=Sophos;i="5.38,289,1491235200"; d="scan'208";a="111976844" Received: from mail-dm3nam03lp0016.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) ([207.46.163.16]) by ob1.hgst.iphmx.com with ESMTP; 05 May 2017 06:57:18 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=pIIrig9LPMf9Zai3gAYzfi5G3ygtrmHdlQsFHtvoMwc=; b=beWbUjigDHe23/DNgmMXYYm5KGV5Sn6s0JjE36Nb5DuFPuyyfdGFap57fMnp48xWvLkhoKdWi5oTyJ6zCUlomHDpE355Wxd3TyPtQkt6ipw3L7KZggJwbOubkBr4jZ6uEdInvQTq/j3RQ3tSDd6ZHVvCdMtFA2Oj+bnHMzRUphM= Received: from BN3PR04CA0034.namprd04.prod.outlook.com (10.166.70.172) by CY1PR0401MB1552.namprd04.prod.outlook.com (10.163.19.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12; Thu, 4 May 2017 22:51:11 +0000 Received: from BN3NAM04FT003.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4e::205) by BN3PR04CA0034.outlook.office365.com (2a01:111:e400:7a4f::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11 via Frontend Transport; Thu, 4 May 2017 22:51:10 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BN3NAM04FT003.mail.protection.outlook.com (10.152.92.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1047.9 via Frontend Transport; Thu, 4 May 2017 22:51:09 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 3B.D4.29323.C50BB095; Thu, 4 May 2017 15:51:08 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Thu, 4 May 2017 15:51:04 -0700 X-AuditID: 0ac94369-548749800000728b-00-590bb05c9d0a Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 78.F0.11415.850BB095; Thu, 4 May 2017 15:51:04 -0700 (PDT) From: Bart Van Assche To: Nicholas Bellinger CC: , Bart Van Assche , Hannes Reinecke , "Christoph Hellwig" , Andy Grover , David Disseldorp Subject: [PATCH 15/19] target/iscsi: Simplify iscsit_free_cmd() Date: Thu, 4 May 2017 15:50:58 -0700 Message-ID: <20170504225102.8931-16-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170504225102.8931-1-bart.vanassche@sandisk.com> References: <20170504225102.8931-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRmVeSWpSXmKPExsXCddJ5kW7MBu5Ig/7z/Bb7Zz1jsvj6fzqL xYI3e9ksVq4+ymTRtvoMo0Xr0rdMDmwe97cfYfLYfbOBzeP9vqtsHuu3XGXx2Hy62uPzJrkA tigum5TUnMyy1CJ9uwSujPtHZAo+ClU0LZjN2MC4jb+LkZNDQsBEomv/E8YuRi4OIYGlTBKn TixgAkkICWxllDgxk7uLkQOs6PdeaYiazYwSi+Y2MILUsAkYSXx7P5MFxBYR0JGYdfcFO0gR s8BtRok1j1ezgSSEBewlzt28DlbEIqAisX3HHrAFvEDxk0dOsEBcIS9xdstOZhCbEyi+d8Z9 qCPsJNb0bwa7TkJgEavE73OPGSGaBSVOznwC1swsICFx8MULZogGdYmTS+YzTWAUmoWkbBaS sgWMTKsYxXIzc4pz01MLDE31ihPzUjKLs/WS83M3MULCP3MH490n3ocYBTgYlXh4F7hxRwqx JpYVV+YeYpTgYFYS4Y1YARTiTUmsrEotyo8vKs1JLT7EKM3BoiTOe05maoSQQHpiSWp2ampB ahFMlomDU6qBcfdpSUm5JjdLTrUTE+18zp2+1595ivmxd8T8ijWSRTvXmLTyyM6yDvJZefN7 Xuvd6fqT3hdeC151ZsN07qNVazfovP15rs79z5y4ddf+myu1ynMlHw1ZcGm5oMOfn1Oczzz9 /e146+G/TI+eloqEnmU80HA+5q/71oqcV+3Hf8iu3x/fmnKycacSS3FGoqEWc1FxIgAvOTRp ewIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBJMWRmVeSWpSXmKPExsXCtZEjRTdiA3ekwa7fFhb7Zz1jsjj4s43R 4uv/6SwWC97sZbNYufook0Xb6jOMFq1L3zI5sHvc336EyWP3zQY2j/f7rrJ5TFtznslj/Zar LB6bT1d7fN4kF8AexWWTkpqTWZZapG+XwJVx/4hMwUehiqYFsxkbGLfxdzFycEgImEj83ivd xcjFISSwkVHi3eQWxi5GTg42ASOJb+9nsoDYIgI6ErPuvmAHKWIWuMsocab7ExtIQljAXuLc zetgRSwCqhIfWy4wg9i8QPEZ96+B2RIC8hJnt+wEszmB4ntn3GcCsYUE7CTW9G9mnMDIvYCR YRWjWG5mTnFuemaBoaFecWJeSmZxtl5yfu4mRnDYcEbuYHw60fwQIxMHp1QDo732JDUrzX3m HnE5EduFtmgats7zNNG/bSZdrF5yklU/U9RN8uA6cfnpKhKsc3c/vL2I7Y7jCdZbt+yXzOa5 X85idepFcOAMp7vsRw/d2FHiyasvs0LmfIZCd3DnpSKunTw1G3yOZFvUMrVO3n0lWI2Rd+e5 3UZPX/24vF7+yGZr+/thogWvlFiKMxINtZiLihMBuTIQjcsBAAA= MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(39850400002)(39400400002)(39450400003)(39860400002)(39840400002)(39410400002)(2980300002)(438002)(189002)(199003)(9170700003)(478600001)(54906002)(36756003)(5003940100001)(50226002)(8936002)(38730400002)(76176999)(110136004)(53936002)(81166006)(2906002)(5660300001)(8676002)(50466002)(305945005)(356003)(77096006)(48376002)(47776003)(189998001)(50986999)(86362001)(106466001)(4326008)(6666003)(1076002)(6916009)(33646002)(2950100002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0401MB1552; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN3NAM04FT003; 1:lW3BsX21XPVxweiwTMCSN4s9qDaP3NshW7jDQrSA3SLBuv7UzsA86YZ1SZRsL0ZYc0CxkdxZTEuWVU85sUO8BM8OhzhVQjigpKXdT/LDiZwjq3nrzYV75El517TZHZfB5al1rDOdWkkGnmkx8heGBAmjnhj0gqcKaEFf0enIk6Zb9xl9MbmNbaIuALH7HLWlqCY0lbXTNniLjp6m8/1WQzwoJTbLXM0w5UwoyZckcbtSbpkyqe9RSujVvYxIR1oghNPaVr/EPTohl5eJ/ObgVdpyRw7jOccbie5gBoYb97twJ2ZpNGp8UwBN12bx1kCPwfnz48DqQXFQpQ5X0NAPfeh1liZ1Za5nv2JYxpjcps0Y41okb9X2GotspqiM5kDoqYZIMkKmRbYRHeaPbRORj3zj0OZwX/kN+whycAa1lz1Hv6sPbWh9pPYZ+93zrDxrWzoO/us6GwnJ7vc/fo4u7yUzR62F8IRKe5xPX7UBOor4o46pwuKUpuxNUHNZPVS9eWg2rSlzs5QtnJ0Cs3lIrHlmRpDiTdxXX1gLczU4nWY= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ee072d9c-c71f-434e-95e1-08d493400ef8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:CY1PR0401MB1552; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0401MB1552; 3:popqxYB2KrjRDKT1vpFoYsvd9Kx1Vm3P+fsHOJBSxKL9Ttl2sbiRH6Aj8jfS6QD7vqGCd29npepG0NvZfh1YAryIiJ52Pe8LqsegwLKiC8IXN9kXy2UYcusjdZZIICrUYYea9BWrC/deg99BZw4kCxhoHcIyfqW4eO9w+OwXxeNk7VvUo+euTgFBBQkBSacVCo0pSZMGyEzOY7gvr4e89EgiRhHmgozHDLOyCr17VwLoKWxEME0DO+pf6gm4cR19Og1LgpuJtS5vTpJsJbYZDX9tlwcnQytKE2YMSt40FPp5MDbkVtGi+GzjP4rwqq6VzAGx8C9kdNhAeIDxGdwgC3rrqDobXgwK7cp/8ngVm+xUkLURZDx3rtrtm6ZPP9Shw7dJ5/F9CRzVbNp6BMMrOGjmbQuF7qUgpf6SOCQLHIQAYfXo3zYmWg2UZMZ6l9hMYwrxmKDiBIzJbGJd3SLE1rsW+N5t78tFnX8hgR4QTcoEKVJfdOb1QnUnFQfbyIVw8MevU99Ho6J6/AxgBCO1OA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0401MB1552; 25:u2dMmOC7zrcdDwhf/zG/caVX9Hnsr7qkxi5VSfvQJxdfD3D+piSjXIQmcLPL6X+nrZtSXT7mx2OlLvfroF6peAwK7usxbArtS4ItWfjStFpn3lR2iw5x6GGyM0ns/L6bVZvfe4PPxpFxdu6Y02AN8/Sj1WMLrsplpd+HxCa+WU/akYvoCxT0+DGwBviC6vEeREG6sXH3VFaVhSQEmAxvHe9o8yXhDwrtnn+gC7INcmSmfQR1uUwW1xki9EUayiJdy/Zn8WDMSRPQOjaniQiCYqceeLjdzjNDGQjsY06hyDNnapESZQLvTHJJyUOOtpe86M/vIxkq1DhCjopSPPW6ckZqA9EjddpXymMBhfqPluGrfD29V7IS5W3mURPXWKO1PV3gD9XI0U3GH1c2zd8Zow5TgshUj/LKF2DsVp+76tFNmwTzFzuuTOVidbmIm7bVJIsVe1SVd8MwTyhXZNsnnQ==; 31:aGaw+povHA/7NjFFfpHnl7zcxBHuLxvRV8D5xG/XkZagWy58ymtsi/5OJLMVRN5NFLcXavQ93uO0eePUq3qul0GguB1HTddE33y9fGfJ7LPPDWnJUpW4oYUfmWIGB/uySOp56D/tAL+vB3D4RmM21PCDnzNYw7f440Tsk+6nQeT8t3/q1oVD+QZ3mfmvqsR8ozy/6VT7T4NWHf46ivT72oLF8XtIB218k8IrwUq9bLlOOa426Ajc7F9eVohrG9nGndqNz4tS8S8Tt3IUUTuflw== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; CY1PR0401MB1552; 20:+laIY+0yk8BvEFKb/fW0WbfJ1tgnhuuSJ6s5g6zi6DEBEoP1m2xR7FMumPlZR6K9ABXe3Q/GaboL3alEUKfM5DN9dG6u/555LgFd4EThQk0MkkIztNmdSCJMjBVNdLizbVCqMFwIYGrSxbred6KyIl3eUeNbFsl5LUIEdJH/spvHo43orGBO9U4hSGD48owY+ckmT94VTorn+xgqDIVYNwg62tejkhfeqJ/VJIZWhzAbYy9iq25sAQFAKCSX9Abty9B20xpY7zpsxeAs0kpOvMI8v9rIuXrRgHYpg1ef/FlfI7r8JwuiDG9g2h3IESDi48hndsecrTfFyiKwpP45xwnO14QnHB/ztVo56/xIOxMFQZqfufmtGNdpf4VHg58imYmLK2RcIzQ+CZgEVxPPmG+PZ2Ckt/I0xaesaqGBMB87H8floskv9W3n772dIeUByd3RHjZI4RtHsOMGi4aXc36ZGB/iMmU5nfw08RMImrf2ra6HWXSBGT2oMX9+cC++ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(20161123558100)(20161123562025)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148); SRVR:CY1PR0401MB1552; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0401MB1552; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0401MB1552; 4:kAV5vnpEo8NsAXzDuTJK1iRj5JFi5lT1Byojq5CUPX9W4DzsH5CXGGTpwW2itL46YG1WvAwI47socffsB8FcFrqFhanOHEXxA9+QQ28sS5jVldK6jnmgviKVZetg/oxwZJ8dD0jXHbdw7CZJ/HArSGxfOwnDYZNpDHPiLdNCD7En9aOnFolUo4X1nzB4JISGdhCHtFgIX+P+CMsXxCl19NU73nl43/Sem3g4JIfdj9tZ8xqV371euvBBpEZNa0kWG5fKu3eEBlHNEeZJMasxQXIV59YhyyYu+OP5W7RuZjgusoZAjN8WJJY/p0diiMUP/l9dupFXenmNGGsrnReK/pPXzgIOZBKFdZhxMx86ZuobG0BmuNso18xkMbZuStcG4W78clphKnGzxXToyBM2z0aBV8tS3HCV1af/OPrmDlaAShwFfGxYSUGMbyVl7kT5CpgzhflJgY/Nqzne6ojiD9JlmgG6KFzJP1E3biy9wQeVggvNvFFUmxmF/sv9PIeqZgA3Yv0DKdz9tPFyko3zc8MO2TNdJJccFUSoGM6K9w/qxry+JAVuiq3ijzqrMvtofmRBlG193FiTChMC6iXmqWLlRxgbsx/CykRbxHkm/TGk6OfVmaUdIcAK0DhlfPCHKtFLpthrZ62TnI+tEi7YY0f8DXNSRf/MtiRRxMUpoQjBBRQV0UyWZGs2FIdhxZ0SsKlVW8DSTezjH22YHafc//+R9ximLh8CJPrK9zFa+PAg1X7+PkmFCEfkEPuc8JFWQRU87wdzo1l1GYWvYn2FfvJf4xvsPPwtf/ChqOvhDeH1F7WAeB654Lg7Qpk0nis7+y8kspGF0DIQAp8xkA9ho08mDZPCqmrbkDSxexKSy/cNl1mY9ucwXo15GWrItIrE X-Forefront-PRVS: 02973C87BC X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0401MB1552; 23:TtMUeAb2Km9vcSPGMaGNE5hZlCLq06brnij3aJ4?= =?us-ascii?Q?M9a4twsxeVXhsHq46A+a/A42aAyiZUhWrBR57b2S6H7YwNaIvr+Cz7DCj9Kr?= =?us-ascii?Q?XscMny53RhBKX0QShuxyVajJIYJ9hNmjotOKnnCKbgYJFB3N2Axm3jwUUVaG?= =?us-ascii?Q?ZHN21o2ni9tdFj6SxgjoV+bPvAVHptmIHK8Ak/Vl/QHtIDr30zDqb0OFGsCl?= =?us-ascii?Q?AUxfP4WUx4jSciOYFyHvo+tm7RTszGeduE65ihPEdFrYZZwdgpKnfs4bA8NH?= =?us-ascii?Q?M2+khsFSLqSdh/q8Db8brQBpd3qc7uUiLZ8OKWAi1fxm39AYHs/EBctqonwe?= =?us-ascii?Q?+7i7KKxAdYMe1oQQj6v83NcLLj1rlcTGLX8asFW64hdCBbs0SmAmITa7qthp?= =?us-ascii?Q?YB/9mnl63n8HXuWBx8dGzW9j68sI/0v+xL2inwNcBnx0igXmgyOnB2JsW7RY?= =?us-ascii?Q?tq1ldJ3zr56+XaInZLECFt1F/T8f/yQVXiCBT1GRIarTYb5obtHsKhH3i92R?= =?us-ascii?Q?GP/uYkfr2DjNq8L0dSsU9YdD2yfoQeD6/zuJ1mS7/pM+eXZnbc2LtzkjnEwm?= =?us-ascii?Q?1eRKb/mG2JDi1PO7Xc6sWMIPEPfFiGT1rCR2sR/9rYKCEqbrpkmA5AoSyKJl?= =?us-ascii?Q?mvK9XLk+BovGhu8amyXq9TnQwMrHJeSNr1+PKhPQJxHrBbrLzekAb6JP/gF4?= =?us-ascii?Q?TzGrkJFPyJBxb+rFqp/fAZZhqSKwws7RMPMF738A6uA5ALzADswzBL6XgfwS?= =?us-ascii?Q?FNmicWtTArz6NUQLnxrCxCfSeWGZ8czfQpppNpuGRN6IoKAgp/RQp6mSH75O?= =?us-ascii?Q?dZ8R1fbWxpFg5EJVqXRmlAA7p4BaqHfL87mRIfW+63++iAwIWS/zWO0v9SOS?= =?us-ascii?Q?186TQ5/uDcvfKBf+3unbFT29wrE+rh5tVPyjHjDMt6LAx7jO5OBuig5uM6Zh?= =?us-ascii?Q?McbVVrJzGSbExFWtJJmzVwlOY/SZY3WSEsMqCUclapX9/3TU9Rb1Kn48vWlv?= =?us-ascii?Q?4pg9UQSbc+8P17Dczrjbv1Mxpd9BpqBBNYD1lUP+Gq12jT8jxchMR55NzfVy?= =?us-ascii?Q?MOQ0q59U=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0401MB1552; 6:LX/zx6xKhp6Wg/o6DcejzRzHFplvPZSvlKkNcJX/8atGHlmS0s1gsMOFyoA1WRtjjQ2CEH1O7uCGH/97WUbEl23nbioXcA4Rzk9o/+jCg+eagj5oW1uceKJJo68YEskqx7qWxVh40mZFsh8UaoqV7iVRhtzcRBJf5NALvxrdKtMbyNmPgvFAbhXO2mEfzVKzo/6CCsTZapTbIuF2DSllbwttt7ZlgZjQ+xGEoyCYsfbOupS3CFcwoD3p6+qj0kWzEwsMLUdq65OjByNdzPaxNTw1tEJo5Tsp97fwUTCpIgkJlXrCVF17W80gGJ5ZOcUpYnfrbYkYE4geTRpTs/b04lBoFLgHtLGDmpMHQYK5GpcUrghOYJS8AUtWwmVvEH9nqbsB9y3DxXhtqE/pEbwF/rRDDVVkRGsXKK1mig5DuGVtzw498gqgxzB0yYwff7tEEzFba38HrQs4TDPrVhuVep6kowm7C7jn0J78Xk249e44+NtnVOSHhbzny+Gt0qz39nyQzm1QjHi3d/2eZ0x2N0F/46EWtKXijZwGGyeH3mg=; 5:SOwcM+9VnGjNziiq7GuNjwKqp8QOnpHgJZmzBFFokEwaio8NqRJ9JPIl9kMS0uIY2W62lC3XhaLPbB0h8NQvhdhvpDdASVq0y+8dZ/LvEWLV3Ijp0L2IliDRyCTNswv51PBeJO3hoppuPsVpeCd4sA==; 24:zcepvCZK0bGyybUFxXfgJCg/Crc1AKNwfUFqJ/K06VP2aFjhldmlfxmf1wX/7HXfjI6Oz7egNxMqmdDyMLaWCuLtEb+a1bBLjKK5NiOIV9w= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0401MB1552; 7:9qdzD7iUiNOSleSozEr7spsrT0ocgCpmXeOe+AQ5jNxJImqQ/GTtpnCOZYsW1WYi9D/RdAkEFCL6DbFIlXo8W2ue3ukPQBWS3RDOairYsDBpO4+fRfcgeYjMxXsxaPpU6hiXsMXVsqtpEy8DvO67/pIWKznlm6Cmuvhw/xluIILEkU81uksZsvHeSSQAa5/SYGpCy/k/BIocaHF+6II+GrTfIWHuIW2fFhGTRK/vVHa14m1qPImg+udkjkRXx+EyhrKAvQft64Mng1SZ8Z38hrzgcQ6KVSP3ExoBgwAtoCGjKPjA2kuHzwpxR94giVyUXf+rIrDFN5ekCTlJl3QfNA==; 20:Y9S+Nz8wLvlMSHR98D2Y9VFB7AWs9VRR+WrCcY9iU8T96ljei5TTET0sKD9EO4Vb0jgwcU+Nz5xsmJpFyO7+e1BoRmtrRBHM+EWeexrawu6ZuPsmcBJZfhr7Vytc6gvf6WkhxcFlkmb8Ox008VDwWVDHTu5fvHFoBwTiqc9tVLk= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2017 22:51:09.8663 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1552 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since .se_tfo is only set if a command has been submitted to the LIO core, check .se_tfo instead of .iscsi_opcode. Since __iscsit_free_cmd() only affects SCSI commands but not TMFs, calling that function for TMFs does not change behavior. This patch does not change the behavior of iscsit_free_cmd(). Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp --- drivers/target/iscsi/iscsi_target_util.c | 39 ++++---------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index 41b9e7cc08b8..1e36f83b5961 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c @@ -734,49 +734,18 @@ void __iscsit_free_cmd(struct iscsi_cmd *cmd, bool check_queues) void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) { - struct se_cmd *se_cmd = NULL; + struct se_cmd *se_cmd = cmd->se_cmd.se_tfo ? &cmd->se_cmd : NULL; int rc; - /* - * Determine if a struct se_cmd is associated with - * this struct iscsi_cmd. - */ - switch (cmd->iscsi_opcode) { - case ISCSI_OP_SCSI_CMD: - /* - * Fallthrough - */ - case ISCSI_OP_SCSI_TMFUNC: - se_cmd = &cmd->se_cmd; - __iscsit_free_cmd(cmd, shutdown); + __iscsit_free_cmd(cmd, shutdown); + if (se_cmd) { rc = transport_generic_free_cmd(se_cmd, shutdown); if (!rc && shutdown && se_cmd->se_sess) { __iscsit_free_cmd(cmd, shutdown); target_put_sess_cmd(se_cmd); } - break; - case ISCSI_OP_REJECT: - /* - * Handle special case for REJECT when iscsi_add_reject*() has - * overwritten the original iscsi_opcode assignment, and the - * associated cmd->se_cmd needs to be released. - */ - if (cmd->se_cmd.se_tfo != NULL) { - se_cmd = &cmd->se_cmd; - __iscsit_free_cmd(cmd, shutdown); - - rc = transport_generic_free_cmd(&cmd->se_cmd, shutdown); - if (!rc && shutdown && se_cmd->se_sess) { - __iscsit_free_cmd(cmd, shutdown); - target_put_sess_cmd(se_cmd); - } - break; - } - /* Fall-through */ - default: - __iscsit_free_cmd(cmd, shutdown); + } else { iscsit_release_cmd(cmd); - break; } } EXPORT_SYMBOL(iscsit_free_cmd);