From patchwork Thu May 4 22:50:49 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: 9712867 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 54D0B60387 for ; Thu, 4 May 2017 22:51:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48F1228639 for ; Thu, 4 May 2017 22:51:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D3BF286A9; Thu, 4 May 2017 22:51:34 +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 BC71528639 for ; Thu, 4 May 2017 22:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753199AbdEDWvb (ORCPT ); Thu, 4 May 2017 18:51:31 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:22105 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752971AbdEDWvP (ORCPT ); Thu, 4 May 2017 18:51:15 -0400 X-IronPort-AV: E=Sophos;i="5.38,289,1491235200"; d="scan'208";a="15312321" Received: from mail-by2nam01lp0184.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) ([216.32.181.184]) by ob1.hgst.iphmx.com with ESMTP; 05 May 2017 06:51:13 +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=93aaraBbWGdiyXz+sGleCQ3WP8PijijH49KzcDA+vbw=; b=ERRnZogSGrX4UNw9E59u6GQ1jBjnThk3pFXLYL0N0tuVhpgd4kNlcC9VwFyLthHMfX2DZjiYehn8KTBuatJdORb3sBdSx5cyytx6bgcTqYoxr7S6Ag3VVFwsIZSAax2I6r804D1jYxQ+2XZP5D9N3Z3LkNnkDn+sPrlTF2WzkSg= Received: from BN6PR04CA0002.namprd04.prod.outlook.com (10.172.194.12) by DM2PR0401MB1214.namprd04.prod.outlook.com (10.160.217.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1075.11; Thu, 4 May 2017 22:51:11 +0000 Received: from CO1NAM04FT038.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::206) by BN6PR04CA0002.outlook.office365.com (2603:10b6:404:cb::12) 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:08 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; linux-iscsi.org; dkim=none (message not signed) header.d=none;linux-iscsi.org; 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 CO1NAM04FT038.mail.protection.outlook.com (10.152.91.26) 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:07 +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 66.D4.29323.A50BB095; Thu, 4 May 2017 15:51:06 -0700 (PDT) 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.319.2; Thu, 4 May 2017 15:51:04 -0700 X-AuditID: 0ac94369-548749800000728b-f2-590bb05a0393 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id A3.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 06/19] target: Fix data buffer size for VERIFY and WRITE AND VERIFY commands Date: Thu, 4 May 2017 15:50:49 -0700 Message-ID: <20170504225102.8931-7-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+NgFvrALMWRmVeSWpSXmKPExsXCddJ5kW7UBu5Ig5lrdC32z3rGZPH1/3QW iwVv9rJZrFx9lMmibfUZRosFGx8xWrQufcvkwO5xf/sRJo/dNxvYPN7vu8rmsX7LVRaPzaer PT5vkgtgi+KySUnNySxLLdK3S+DK+PH3PGPBN56KvTuuMTUwXufqYuTkkBAwkZhzcjJzFyMX h5DAUiaJ3mnTWSGc7YwSS48uYoKp+joTxAZJbGaU2P1+KliCTcBI4tv7mSwgtoiAjsSsuy/Y QYqYBb4ySjTu/QtWJCwQI3G76w6YzSKgItG45xOYzStgJ3FlwmU2iA3yEme37GQGsTkF7CX2 zrgPViMEVLOmfzMjyFAJgVWsEsu+nmaFaBaUOD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essage: 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)(39450400003)(39840400002)(39850400002)(39410400002)(39400400002)(39860400002)(2980300002)(438002)(199003)(189002)(9170700003)(8936002)(54906002)(50226002)(356003)(81166006)(6916009)(76176999)(53936002)(478600001)(50986999)(8676002)(15650500001)(305945005)(6666003)(2950100002)(575784001)(2906002)(189998001)(86362001)(5003940100001)(77096006)(38730400002)(5660300001)(110136004)(50466002)(1076002)(106466001)(36756003)(47776003)(48376002)(33646002)(4326008)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0401MB1214; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT038; 1:hbd9C9l6vv8WPEfXirI0gQ+jOJKNI+InB20kxDK7FVQgpBrdrBKbxK08XWjTTyaLxY/Uxmc0CbUnK6Q9UbN6+zb8Fr8HYfrlK8kHlnGB5gmlSl6osiWTPqxQToKQfrpnOvLFURRxLV8d5fFel3ZgqrNdFB35ZsE3VqBJzgd5lGXqXvPM531g8TpJA+bK6ooS+OPOfD/jBRtx++7xceBy/gUr/DpNBgNmhBzpdS09hyUY+wSwXrl5rIIGsIYieF55Ik74y+i+ruBMhBvlnjfDBIy5vUV9SDWen4N9o6NK52A4Hi7zL4FcR8BCUs+yZZ9tvwPaipaUPTmWm3Lhu+xHNj/oX9a4f+VoNzqAeRNZxZHsrLs3Bv0CNNmvMjW8fGOVU4NciXq68OEeuqduUMprpsqFWuKdsDAPPuTJyjk8cUvclB7Yl3gVelyZXO6/hC/hzW2JxbW0B91GsdLmcVbnhfKUc5uuVDt0Fii6j/jtAgxpp3BfJbFiG+zf9PJiTbSN X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd69faca-fa56-42e8-8bc0-08d493400d6b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:DM2PR0401MB1214; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB1214; 3:HP/uDm5bnGDLY29gqwuC0zHgk2SbGAN7R/94vdGJ4KesoHDjjOZTrZIe4gjnqoFRffeq0IvFSNIVUoDrBLqI5mxT34dXr1eFO7ht17x+2Gcm0rVFcW+JM3Cq6yStldIdxxAtXksMrAeR7oRxCDUaNL+bCkLOkaJ/v9BHr8FIwTRMNLwUuz0qKdQY1mPO0kI5sbnKXPdVHY5q3ekY3nXSDcNMeycp+Qm70u4biN3YOz7PQDRA5bmBN89bihRaLfJ1dc1W4gYrB9fvCuT/Kyxi19Q36L5UdfkgdHMpARLRLVNPwQtVMgKa5hOuZ3ndnvdz+DxaYTTE792GlH251dSfkyIWY3JFb0oblRB5k3yfu6utvQAiRd1qWyZTod8G9Wjfx+fx3HiK2GhOXXLL6Kf71jEGYn820jYcesTR4jso+gQMyspHBQhsvM+3GSEmGoVmX/Lq9L4g8b0YrEXli85AKb+TBrccFckK1w0hDWIQoJ3gArypIbOp3Oeo1ZKGI0m/ X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB1214; 25:C5tUF44bc8zzyuJ2sLHE+PBvqs9iG7bJjpEfGzlv5KJDKtapP7xESmEjloUjg/JHqPFtoCULGbj/kY7747lg7oKe96cTvjMU9SM7ZA8kjf9J95IidvX1F7ZnBUCnBKOI+uQC2ZDYC0pYFIllBbFab/GuQaF92pw9ccBoRnTGlYMmT6RmXn+b9lWa5k5bBmSvH/fxnz0P/fIh37pPnNQFNnnh7OiIRjwgrj2n+zyFVTxuKOK8ckQjx/UKSPMJkLrodDojpQPqGMQuF6P5hGP6YWJOyH4oqpEKWQDAtgO22bpHOkX0O2TQ9cuB3111YmF9CREcH5/2qMINNUEZgkpxXf2+m2NsY16BG0O9bucu7qYtUHua9zn2GYTQp/6Yb0x7z/ZX349DX0s90u9vyBk/o6qQajPV0OwOYGuLzt64/l23wk7I+xnNB13R26PhpU8nfPJ6mQmiiwQJnZlVeEIc5exepH3uVUufOVPbMM3xOuU=; 31:z6PQcc+IS0aziFlLRUOqAFG6myhp+P8ss8x/6hGOu7g+6IjoKkaEgJ+vxnC7/JeAC2XSWQ3Qnwlcvkr99KmV0w8kGiKWDUBKZqjRx6Vdq116uiiRRDLahX5sEGklmJa8A1nM/1xcJIK3jcszzU28LLYuFPc5at7i39W+7Wi3Qq+jqvEbVJ62cL9eRr7RJx4zMWn+myojg1D4TBL5+xI6HcvuIBMjkOt9uZ63RAOhwU9Bo0teI0HveqZ6z7cdCEf22oLhxLMRqX9DMYnQWknFiQ== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB1214; 20:x8XzGN3aKwYTaJvlU6ogEHOwy1d9ZgUHFTXdrKqpfioFKCM+r9ie1Pp6qhWEe+GR8qHBbynYRTHSa3k63plZlaXRquCEk+j3Jj85X6H8LuacJEJjCLHDp22dVzOA5oUCNWJ/MKCsPMw2VHwqDx4UA7Smu0Lqeo61r7dsp9uyitQwnxbDs4h/ygx8ZsyzYTUMITmZ8JAfRLTV6ArZ84xy+xYLJALa4hh3keoJlJ80yygymUkedTKdrGHpnoI7wzjO6oCCOL/fOxFkUio95Ubnbm3XLI8lmfvfxrCBvL0e6VqWfXTjKNfw5yFnsU1NaZOAxNCP4Z6+9H3taCsb+v2yrPSoPUyMUnkr0ThWShV8wb39c0V6kBrh6ux29PjZfgAVLSFsk1IFKfFQpI7+w2+RdQe79EVfoXmki1tNlQ13eOXyPn30AXSQD2je14DxVGmrX9SsYaB3dEJWnfUjVges/JcziBcI3HC+4QEtv3fRJ8LsLLI5en7cfOVs0qqlDvRP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(10201501046)(3002001)(93006095)(93004095)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123558100)(20161123562025)(6072148); SRVR:DM2PR0401MB1214; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0401MB1214; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB1214; 4:b+HdbrgKDnt9ZxoRhrp33t+2+eIC3M/oPLr+wbTAw6Llm+lsnHwBC0OmgFRQS6iwNEOgqC2dkiiQe72IcYOxPXaRVZOurmAxXds9ducyDxl9nX5JuoVAnakzvnIsvGSbO4KDutfFM162On83iCiPMelKgznGhCUEdVKUT6MAFrEwHeAkNi+6OxAbCKpCANmVncQhnoTs67leZBCXlTdcLT/zGnpUN+fw8vYTjVfr7HbYZce5xuoD1XijFdxahOV5YVdeeU6OonRTvNRx2y5biNOiL+nnHs3qsN0dQsmJ7ksfwvgw+/c886YhxuOyW5BvZQItTHe2anM0sFDDFjWxIawqHquNJWhchEX84604bgeQt9K32kDGJ6KDOCpgTAfK/aeIqMgFOAXiHQLhv7p9NwsAd/9ISWx5VL/dCCb2U88bNU/j6agTQrqh2RUfpX2VNbcvWmWlXMNaZZhK+HMuMr1W1iWNlMBiVtELpAiH6tGDAMH9nzJtuaLsDjtvajfR2Uo1NMA3pIXQMhtudM0QJY8L4OLRuITLcO+idsTnjnKO8xYVLaNYV6QWTouubFdczloDDC+gZyMRv0838T6P9lsOfhLK98mZBGEGPfxW1GYJqXxwYLGX/W3JM2R/gbTbay6OYVwcClFmyIw2xjGbbrT1ADnkZ9TjVZBA5g5brgxYi22nQcEVkN2/L7rWXjimOYFGyxqnBPleCwkrEVAV4RT9mj9YF5CBQu9CzBhPkDgW7v2HUSd1zEur5bmBHFGeVN6xrCGpwjUVc0CKbpCsL3BKnwwZFoKkIgJm/McRPu3cFFvmXBKs62pSvxWQFvmJ5v+Y1XDzlwIZiHV4TCZICJ3KRVdD46BoHManKx0ySvda0R8QExXr/6x9agnU7msX2WR7JZEli/zP0JQlnR3sYtsziTarxYdRsrL8tzRw B7I= X-Forefront-PRVS: 02973C87BC X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0401MB1214; 23:S6Sn4sdU6QU7t1UXzZB9qivCKYjxeYhx2dQnHHY?= =?us-ascii?Q?xvRz4elMlt0U7e0tDh/rIp6DY8CknseZps4a8DQK3+ovluhWmjaivMglZlhY?= =?us-ascii?Q?5DNehZFjPtSDiDISOTn/n0iWdAV/KZiIbseGArAJovUCn83PNSf7uhtfKwV/?= =?us-ascii?Q?9LApDCaYZiNxlfMGTrqIuYeBi7CVubq9gTU3SqKIrTs8xLLIozVL5CKA0PuG?= =?us-ascii?Q?93O4rSX9FqTKwX+c+gccRQ8UunVIecRVJpOunr6WsBotDXWYKckHOJKolyyk?= =?us-ascii?Q?UNJv2lzkBbmJ7ZfQl+OU3GZrxPZ547rE6qTjpTCyBpnZ5+W2swrFXnFm+PCm?= =?us-ascii?Q?Fw6lABB8qQI84M9u4vxUN3oizM6xLSSBFNCD3qwCI9f7l5cvyLuagHk4CySm?= =?us-ascii?Q?dIqfhgZ/Fkvxz2Z8BB/+olyam4wE1ych0uB74gzrR96odVLox9va+xgjk1rU?= =?us-ascii?Q?GiRCHgFqf9lYlUCJp+z+mZH9tTAn1WGq2sEhlncrMSbRi/sDoSYoVDsQjRsi?= =?us-ascii?Q?U+ZwbwMehsvVLm1IYkgXtn97HL1xoWqhHoColuaP9MNwtGcReiwI9kA1+kqY?= =?us-ascii?Q?jhjjh0cIunQCBRLXb8BqbbmRtbGJUX8cVveM5YJlQuw1rjpAQ66s09gc0/vh?= =?us-ascii?Q?RjK3dI8TjCZYoz7wi8iKogVVHncSmr4ayXYZncdAFhiuO2m1dws3zv/LFMYY?= =?us-ascii?Q?Aktx124K0efFq1gtcZj+4NrzhUNwMMoRCyMwbU6oAsZBAq2EVdhEiuFojRQ/?= =?us-ascii?Q?BsienpuKnS2I2PXOj0/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Ld+YfqHYt5CnsZhHgHgSZrlG7GwrloFCIF2Mo8yCthcnj7gCyD4SvRnDBWhzj+SYpnYJSFw9n1YCaNBlDlUMx5CzU8JaL1/W/lqn1U615R+FmxUI7AVQ==; 24:67J1NYkkG//wlDaUERovirH3zVFbYuDoJR64LS/Yra+/JJoK4YuqVKn/MVqohOXL0V+Tuu6FZsO5p0Lj3+3cMyhmgjpy5o2aKkUkgmYsfj0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0401MB1214; 7:E51C+2Zo0O6WDy6jiW9SJQdNQH04n02RqULE1G+xZDyz2+tJoaSgUcJc61nYVEehzJ3c9VErOvaxSCj7zQSxg6J4mqky0XjVVprsteqLnNqQBUPo3wuAgEFtG/N5aEbX+DW+JEBroTQaoOPt5o+kibUk0EZ798CluMW7JoTIXzdjfXYvq09g7Krw/jwa4GHoOfWhInxNX/JA8UQFPEG5vKkwG6CvYqcOlQ5gVZxiNWzAUZsKyAYd/f4hRA6bBB2INuUHGVdbBkw/28prn1tp0Y8hOmSqh8TljPGQqPamTlWEkhTRRDHcxQMS+FiRd9R4+NmC0yNU06/d7+OBIcEEPQ==; 20:gOPSXnh+iPUL3lN+3VQTwcs3SE6FNWnuBb9PNvFlNSoYDK9Ui/CanwLx+Xg98GQ/NVwC/zGQXL1dQ/vl6FYPf7glqfT73tm5jsRn2EWgh5Uhpn7yOWpeJJ8aiP1pLSIPXCjGdMdtulzamk9PSRwmPFrJU1bPkpAPeUS+Qetm8SY= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2017 22:51:07.4205 (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: DM2PR0401MB1214 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 For VERIFY and WRITE AND VERIFY commands the size of the SCSI Data-Out buffer can differ from the size of the data area on the storage medium that is affected by the command. Make sure that the Data-Out buffer size is computed correctly. Apparently this part got dropped from my previous VERIFY / WRITE AND VERIFY patch before I posted it due to rebasing. Fixes: commit 0e2eb7d12eaa ("target: Fix VERIFY and WRITE VERIFY command parsing") Signed-off-by: Bart Van Assche Cc: Hannes Reinecke Cc: Christoph Hellwig Cc: Andy Grover Cc: David Disseldorp Cc: --- drivers/target/target_core_sbc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index a0ad618f1b1a..51489d96cb31 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -888,9 +888,10 @@ static sense_reason_t sbc_parse_verify(struct se_cmd *cmd, int *sectors, sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) { + enum { INVALID_SIZE = 1 }; struct se_device *dev = cmd->se_dev; unsigned char *cdb = cmd->t_task_cdb; - unsigned int size; + unsigned int size = INVALID_SIZE; u32 sectors = 0; sense_reason_t ret; @@ -1212,7 +1213,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) return TCM_ADDRESS_OUT_OF_RANGE; } - if (!(cmd->se_cmd_flags & SCF_COMPARE_AND_WRITE)) + if (size == INVALID_SIZE) size = sbc_get_size(cmd, sectors); }