From patchwork Wed May 10 20:37:33 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: 9720645 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 0B2BF603F8 for ; Wed, 10 May 2017 20:38:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 231162862A for ; Wed, 10 May 2017 20:38:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17CB728649; Wed, 10 May 2017 20:38:06 +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 7A0082862A for ; Wed, 10 May 2017 20:38:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753541AbdEJUiE (ORCPT ); Wed, 10 May 2017 16:38:04 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:13663 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208AbdEJUh6 (ORCPT ); Wed, 10 May 2017 16:37:58 -0400 X-IronPort-AV: E=Sophos;i="5.38,320,1491235200"; d="scan'208";a="119286188" Received: from mail-bl2nam02lp0088.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([207.46.163.88]) by ob1.hgst.iphmx.com with ESMTP; 11 May 2017 04:37:47 +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=LxGd9/uxlmITzZw6W/0uIxJ+w4a+Jih6WEbTSIH1QPk=; b=S+Cl5stKmZW2tdM5Za6HjdS8ZSyBvt7WEAaLL3EZIKy7RDhDp5eyI73Z2tsykl6nHXfM9YvIguqPIXJ9W07X1Y8xMj3bIE+qi39ekI9ci9AAv04kiPYiRPV5OyKxYuYeTzUgjQd5XKa9986+p0DCpo4PS3fKFhtmp70p0C0qg8s= Received: from CY4PR04CA0039.namprd04.prod.outlook.com (10.172.133.25) by BN3PR0401MB1202.namprd04.prod.outlook.com (10.160.156.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Wed, 10 May 2017 20:37:44 +0000 Received: from CO1NAM04FT064.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::200) by CY4PR04CA0039.outlook.office365.com (2603:10b6:903:c6::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16 via Frontend Transport; Wed, 10 May 2017 20:37:43 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) 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.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 CO1NAM04FT064.mail.protection.outlook.com (10.152.91.144) 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; Wed, 10 May 2017 20:37:43 +0000 Received: from MILHUBIP04.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 C3.18.29323.61A73195; Wed, 10 May 2017 13:37:42 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Wed, 10 May 2017 13:37:40 -0700 X-AuditID: 0ac94369-548749800000728b-24-59137a16b326 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id CD.3F.18148.31A73195; Wed, 10 May 2017 13:37:39 -0700 (PDT) From: Bart Van Assche To: Nicholas Bellinger CC: , Bart Van Assche , Andy Grover , "David Disseldorp" , Subject: [PATCH v2 3/6] target: Fix data buffer size for VERIFY and WRITE AND VERIFY commands Date: Wed, 10 May 2017 13:37:33 -0700 Message-ID: <20170510203736.12462-4-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170510203736.12462-1-bart.vanassche@sandisk.com> References: <20170510203736.12462-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsXCddJ5ka5YlXCkwYdzchb7Zz1jsvj6fzqL RdvqM4wWCzY+YrRoXfqWyYHV4/72I0we7/ddZfPYfLra4/MmuQCWKC6blNSczLLUIn27BK6M 5hMTWQo6eCtmzP/F2sD4kquLkYNDQsBEYt0pry5GLg4hgaVMElfX7GeFcHYwSsz+s4Qdpmjy VF+I+GZGiSOT1gDFOTnYBIwkvr2fyQJiiwjoSMy6+4IdpIhZYBOjxI5dfxlBEsICsRL/55xg BrFZBFQlPr18wwRi8wrYS/zu2wU2SEJAXuLslp1gNZwCDhJX56wAiwsB1dzoesEIMlRCYBKr xKE/DcwQzYISJ2c+AdvMLCAhcfDFC2aIBnWJk0vmM01gFJqFpGwWkrIFjEyrGMVyM3OKc9NT CwxN9YoT81Iyi7P1kvNzNzFCQjxzB+PdJ96HGAU4GJV4eBW4hCOFWBPLiitzDzFKcDArifAm ZQCFeFMSK6tSi/Lji0pzUosPMUpzsCiJ856TmRohJJCeWJKanZpakFoEk2Xi4JRqYOSpPHKm IVfuSK39kpIdqaq1Rm9v5IUeTlRW23OopuzMSyHrr9c/3zP2cmOVfeDn/3ue0sKiF69/tM2u OhrvaCwt5yzA+2Bb+9zwKOWL1n/SldcqWidy7832rxH87+B5xJnr9yeR5E7pAw8qv6alXJmU YnA3eXJ/8LnDL1ksGIsObr335UL7SSWW4oxEQy3mouJEAD7zYE1tAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFJMWRmVeSWpSXmKPExsXCtZEjRVe4SjjSoGmHlsX+Wc+YLA7+bGO0 +Pp/OotF2+ozjBYLNj5itGhd+pbJgc3j/vYjTB7v911l85i25jyTx+bT1R6fN8kFsEZx2aSk 5mSWpRbp2yVwZTSfmMhS0MFbMWP+L9YGxpdcXYwcHBICJhKTp/p2MXJxCAlsZJQ42/+DpYuR k4NNwEji2/uZYLaIgI7ErLsv2EGKmAU2MUo8PHONGSQhLBAr8X/OCTCbRUBV4tPLN0wgNq+A vcTWxn2MILaEgLzE2S07wWo4BRwkrs5ZwQ5iCwHV3Oh6wTiBkXsBI8MqRrHczJzi3PTMAkMj veLEvJTM4my95PzcTYzg0OCM2sF4faL5IUYmDk6pBsZjGyUDOn9tvLXz5JxFojVH90dslr/+ YL9hQFPFrPuhJbcmMM61fljCsk/TYX+bvdyC4y8rIpZteeH4Y8XbWmbvuGnLlv2e5s0qIebe vnl2x+5H0cfyJ96MXsPCUnfnZ22I3CGLoxISCx58cmddmiP8771KtkDTn/NpQlKPr7rGvisN Pnsy55qYEktxRqKhFnNRcSIAyUbV9b0BAAA= 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)(6009001)(39410400002)(39850400002)(39400400002)(39860400002)(39840400002)(2980300002)(438002)(189002)(199003)(9170700003)(6666003)(1076002)(15650500001)(36756003)(76176999)(2906002)(50986999)(2950100002)(6916009)(33646002)(189998001)(5003940100001)(5660300001)(4326008)(77096006)(8676002)(81166006)(478600001)(72206003)(8936002)(356003)(50226002)(86362001)(575784001)(53936002)(48376002)(50466002)(38730400002)(110136004)(305945005)(106466001)(54906002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0401MB1202; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT064; 1:BKrME6mFZLmSlWsKXgndYEgxl0OD+JdRGvtbrIYJdqqIHi3oD8crZ2dquaR07JYUWr2kRG/tHA3cdl15P4jQnjP5bnf5cKQUDg442hHiOCDuWkReimDm4Yt7lydbLfGJTteSeBngrtYZGfaRIvcnuP+CBnoDpDqmC3gF4u1+C3/h37zAwjm5wEelGnA992XrBC5ClCwSU49yOlQ50+8USgF9ZCajQesoAhvRC+sPxts+FKKMhZBl98TSAvQOjxJAwSw6ML1fWVBnt9vsm+xNCVrbJX5V1iJqjWrzxXtxqcWqeEjx/LfK1YoOrVo3oUGMkM14qqNQf8fMe2Kw5z6nGucvPWhfavfUDU4LP+1phDpu72RrB8IqiVwkVnkiKuFWj4P5x2enqlYnVS2UEpmMJp1wRxOALBfA5kqpvZ8N4YW4/aUxCwtoP1tVQp+JjuGzBgM1YsJwfrZHhg29Z/oCaI0xTY2fMSD0673/dSxRM0kWJIZDqoxgE6XSsPXhKeFEWQ1wONz3mTUjCehKW6tUmSwgpNSLade7NPdNHB3smkE= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ff59b4c-9d4d-48e5-e995-08d497e4691b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081); SRVR:BN3PR0401MB1202; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1202; 3:Ngy3guFFatOo+45Kabh/rKjLGCkr2VjOobrKyuF5f3pbrhIavVgNmXP1CL36p3TpL/Z6nQJ+6IehN7zquyed/8DBVcIZNd8gFAfA3DiZxr3v2FcOXl66GMGsAEeWBt3yzyyFGrS+PvEWOYoF7KhvhQbL1iotEAHmrr5stgbIloYj6EHZpwdO79K3h4ZCFB1MjyTrT5pUs0XDsD7X83lyOJNR6FMzJQttY1XBwGlEtiMFY07LksnoNPaATsnqbeBZomZbtH2FbvJx6q578eOhg1LEWJveaHaBM8PiwetP+UfMBwsI3tivMaxivRKGLeTjQNygYT1MAaQ+1uCrhozBp4slD25QDkzjI/RIcwxqRGOUWvP86AQ+ueNge+26L6sIReVEIZvPRsYuBX4F2y4LIE07ULMW7AubbphiA/nP+kFSvXjWTD+2WvgomwCmD8kDErBVpWtDnDQ8BhrwDs73uhRfkRh9v/ZDDMf7IH9myreANM23fuN2xEEfew+7FPAy X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1202; 25:78T5iaGmJpy6toNc/ujH9UGY9WXWuGtSDGcmt/exlceWpRr4A1DoIs0lhlt6KmZjBLVG4yyCvwKl0QOa73l224hFqjnKE+TXZKi23w4NpQB/dGIPWuuJyv+wkv5LwYd6qVh6pcgjAhYK/CbTJWUnt2ZLHaUYxdp77ndFlekNRRDqQWPQBsYXZ63d0TVrqXvXW23m9pnboIQdpOvzbdOWHoXoTvKO/9NfQ+vyI5c602PpFFK2KngrwznkLRWQKhwj3+MJ1Q5L9XaoQjvirT3KXWVqxn9BXXpgv3RFB8cCr29mINssSgizHOAOQ2ljD4HrGUjBQi6CR/UG7RWbvAe2pwGDHWKNpYMyZuygYIvLEI5jN776UJTlZunySrtcxcKPbcdwsGCvKyEN9V4YlZZ93BlnK15XTerqFNGEZyTAZLLAAJmCKpkhhQAJ2zS5kfo4P2XjxidWCqCaibvrhNMux3v6//xkkQC0ZIIp6qGtP6E=; 31:snwicmhypThMW6Pr9I6J8KdiFungkHxaJXlUtY44poD17qZoJ6eNRyhHMuUamOc+V8t9KIPBE6/EHfpXk7RGpdd4glZGkbchpwhpAKEvPD0usneuRqQl5a1ea5PO5eg0zoiXv1b0JWB6ASe48Dv3GPBul5qPMOBq/DZAvzi+1bT4rq7wOz1INUWOVbSMmzoH1pZB7GUDn0lXs2XhpnVOjpbCuNV+Ir8DRIbFQa/gKzWW0RWTmQb1N9qoh4GIfwT4jLnC+6SmoY78urs0PPISrw== WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1202; 20:JhO35THtB/npCOOXHrQTtCq03Swx9LFKuKi2hqmGUveAoFcYKoxs1xKH7L240kDJuwcDNXhjs26N8s3PgUtrjhEFkGFkBNTnrMMRY85hrAuKKCF+HNSLUBTThRueYKdZ3AqrIfjP+1JDiXwFP4yVCfOxvtyxUVdHRNOWZzrx+HVky4emhxBcIsrl3/GjrbfTe86FlsfWvjYgWCrTkaQMGlkS2XwFyNari9HgVnQQTtEkPiX2pFqdnIuMo+QTvjtRhzOS1xZZeLzAOWy8KoOgS9H8gQD/BGJay3CFoia8uL6gfXeC/dsG0t3F4a9rwQ3VuMGo8WtMjMnRDVA6O19o88kjSpAeotASr3PbAFoBBsIRbjPJ4/hb2BhxlVCp2O5VPC88r6GgLlcsP2DSicNHi8bIQSsyjhoQZBatAeGCi6LLtYdwBvkM7NjvGkvgwBzKn5aBRcglxMYhLEgIJ3PCY2+Vxymtgb3GaI/A7MDmLS0p9oUqqBP2wG5BzD6vQbOV 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)(5005006)(13016025)(13018025)(8121501046)(3002001)(93006095)(93004095)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148); SRVR:BN3PR0401MB1202; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0401MB1202; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1202; 4:Mf65u0xgt3TuOVy8XMSw8ZcOckv2xG0hK7foLrIWDwUhu4/FMMwKLgFrmUx5NQOebj60b++xOs0HJV28HBbigKMqCpnKcQWikpDz5wBCJlA8in9NG5wmu2on2SomMOlJF3E8USbc2vNsF67YkAtGRFhPQqGiSoRwphk7JUJcFkLYP0lXjw6r7G6spk+RgFe5gBVne1rjZVjeMcAcf5gvogskKZ6Hsmq4uP9A8YEpPmIm+RPKZCMbm1XXZEjASf2UQyh4JLLbOYAhTW6ANdvRB0GBd1yCRCU15Y4BbuAoFbnkT8SoKbM9uvkDCpWrZuP4aVuDabdWw4vaI198n3W+KU03mo0DGyfM+fwEOi0uWpk6kWflPLf2gGbtiakfZmldvHbbR8uedlb7ckY5sQOeMUXL5RYpbO8kS8IK2ovb1cxImpS4/7q1lS1vGWlsj0vIfT8Nk/oK0clzx3B1tio2WGUQKDqIlaTe8r2v0kqriE1OC58cMgH4P0k1n8l91ikkagFlY4qgMuFoNgZuFBm4HhJr1DV6rB3IM+IuNsHFWLdQPKNroyo3o3tLe5gqqVeSxjQ59C/9VLhDI8B7Q0aMWWfMpJCUfCTgV1bIwsqdAbNBNyTq8yqvOo8SMZD+KH1UPqne0IO6Du2/TGvNdnRVL2B4yLPLmiJvVnr379zoX7m/3wgPw+8iktfPq973jssjgRjKUKhG3QLM9lnDnuvzJZwXckBo2XSCWuIl1v2RDamKhm/yOykWyV7b9NECZ6ndaDWJmcvUDRacCymPPCQp5GQa6wVePsP1ulj8yen85PmbT8nbNEOvAclnbOlkWw10mXASH7xzTIZe55GApadv7q74vUxfw52Qe7+nk8GlWSK7000GeisvghBIVy6PNN6SaAo4R0WsgzS4AjkAxgu+JMJz0yVLYCVnKE94M0h7 tj4= X-Forefront-PRVS: 03030B9493 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0401MB1202; 23:qMy6ggJkambC5Cg6HQzD6GmtsbDRf5tHwNSkgGk?= =?us-ascii?Q?9HdV/beeFvt67xbce9EUcJ+sjgEcx2jRumMeD8BMiBmOHXiIqZhQYdqdZZZo?= =?us-ascii?Q?7K3BvipUwDGQtfiWASGI+r2GXmArrWiqDS+xUblrS63/XWXbl5fl6tjeq66r?= =?us-ascii?Q?PTE+eOYFmqvHiboEQd8VMudQbFdLTIgr02dPeX3YhAVG0A7c3i47iTL1WmDK?= =?us-ascii?Q?L4b7Cei8xnRIwWeLv3Qvb7g2aoSkS/FTeytkfK2aqLT/Y7QT2BySDVZrkGWr?= =?us-ascii?Q?a4DXL12j6FxYOoVa+YkeK5QO1hukPlxXuapLkszJh2JwamEt1Hb8dXs3fHJm?= =?us-ascii?Q?rPO69ilCqs60UrCe8YcmcICmHydWDn55lPi99VpRqmGNLOjkRpNPhpWngRCb?= =?us-ascii?Q?a0zYrR7oTAnUoBZt8sbRZFKpcW3Yanx8gyyQpuVl4s2azIW6n4k5sPzrdNRB?= =?us-ascii?Q?PILIzBi1nqulV+VSUNMV+Yc+K4Vew1bWAGQ81vndcHmTwNg9wKFFIupO8nJQ?= =?us-ascii?Q?j8b+gBKFPVfioxtR9QNRijfWT30T2+fsaZz8y+RR9s4J2tlLQPxHAUuXUOQb?= =?us-ascii?Q?3OF7MhfB2J/UcLTQTzsS67IfQMFApxjREZw5Jcxc5iSw+qXwXiu/iuCIrAZL?= =?us-ascii?Q?1XxrvHzPb+KI8y1s21cRdya10btfuWk6LIRRB2QZ9DtHQwCQ4IAKG5tFZcXB?= =?us-ascii?Q?c4oosdFSmDX3twU6zXO2qC0Jmzdf1C/wKlbhVbqiKi5/F1w/ciVE7CoaZaDn?= =?us-ascii?Q?l4Kz24FMGRCvc9SOkv9HRudkkh7zC3dLuCATj0PWNGn9IclZAYoJo5NXzk17?= =?us-ascii?Q?YMma+H2UZ8oP3wAqzC61jBPRteczMdgTVJ15knEpEhoc3LkHwNXgqEGUIj2f?= =?us-ascii?Q?4iQut4A4dMXJF7epA11IA8hVmmeopKXCcYA51RZ3X/b1zEdmFpUlypy7cvzN?= =?us-ascii?Q?VN4cVuQYtthvQVSgsIwgHhtdrjmPkkRtspwEmS+hlXT/9uYVNZypxLnzCrFq?= =?us-ascii?Q?C+QkYyHrSJovOUa/StMVH536rbEyo7l7inue/2Ce3OB8ufHxSOriRCHLqhOA?= =?us-ascii?Q?B/YgdUsfvbUw37xQlE+mphCVuzFz493/4zH6VL8dub19X70M1QAysW1Y/YKP?= =?us-ascii?Q?MiQUN9+20B9o=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1202; 6:dQU3zoBbBDYzS12FdkCEqc0olh6+uHsJn57yNb9J+TU5pStiYnszJEevybkc+Cutn3kVk53CrHH2VokRQX+9YnpR9LqUuunQzTz11cv1TXxPdQM4mSRZIaRTv6WrRUJGGkkObFbN+VH5EhMwtcOvEUPrd424oHP/RRHWhDYkl2KdGE9LXpPTN/ZStejsgdPOJgwXEoENWhdDDl+Yvb29Ps19GkkIlIPn/tMKo8XjMcmdIpC7OHeUnWWIyaRdEj7ps48jhbiDgDJZdlM/FbN2dynI4fa41VWnP1wPptgQXEq6XzNk36LPIhVhTPPnhNwBQ6vIUTmn9RxBKPvJrF0OdAE/rjQU6hW8Tye2d1vYwUMgiBo/f1YwJ+p1Rve1tmSzfbuUrnaicDzEKnQRSaBu/f+Y9eTQLYfADUPp9KJI5b20K3La/07kSjmLl6B9kZEvowLuiKPHsXsL1/UVqfVdXl1SRY2PwLYfiICoMhrm2HRyN8I8B5GmIcVyLyHIgFwut32ulvYt2H94fQhHcBQCKYVv46fr+Pg7GiqIznZPUq8=; 5:mSdh0q+AEAzPFbAMz++Tc7bm7BBiSu7G6gT3m76MmKi+qSYUxQaRf47HcsRlXxDlpPihuIJSoMuzMaNs9ueYvEGhFRRRLXdiHS1MHvduP1Z7HUkuc0wAqs/a9rqso5H0mexwSjQ3LWPAcxyRfjPwtg==; 24:an0s2lx0r7aRACwO8h3GhoVlp6jxx7zPgkIVsaZs2KPTrrTAuw5TkubzRzOEZ99AmxXb+1rgNX+nEKzYTntRBQ2a2wuo5f3b4eOXZi1bTJc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0401MB1202; 7:F6IPaYGW5U5lZliVLuYOjTTl84oKj0/fVSnlS6OFtOXYvlLIRJwDNs/j2/W3qGaQEyPkeLlNPkG7+TYSRSW8bJCgrhj5jEMAj2ZxZhgfHhxHnNMhnaUZkTQtcsUT6FpcQ6voAfepv15OxsXYIz1tKZmyam6QpQMIEfc/jSzs1ZOtElJcm3OzuhsOZTpRtkKxSBdm9bB7Sh/OmDNSo1+IsxC0JvCCtkHdNqRPwca9N9ZM/zCzXWz1f0znh7fdezQxpsPHAtTMDKdx/mR99o9vSYW+w9BFFHOQWafw9wkHZTiJv3/HoCF6oU4gSvTwIAHvMweDZOm5VG1AlZoyaLdYdg==; 20:QN0wMfPUAQxUCG4RfMuTZ72Xpu59rpo+Pcu1lcAk7kMkaLmRspb8sdIPXXLo4KDlmDfafB3DDfif9veYwnnyp671Ijcmgqnb9/GRFXB4Rng2antyzFqJ+hdIh54NapxXOOlx6zPuPjP0ZwlSAVVNtKPevpNo8PifkS4/0rUWx7Y= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2017 20:37:43.4713 (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: BN3PR0401MB1202 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 Reviewed-by: Hannes Reinecke Reviewed-by: 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); }