From patchwork Wed Jun 13 17:44:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10462751 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 AA3C060348 for ; Wed, 13 Jun 2018 17:48:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94BCC28F1E for ; Wed, 13 Jun 2018 17:48:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9278D28F43; Wed, 13 Jun 2018 17:48:50 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 493862902C for ; Wed, 13 Jun 2018 17:47:25 +0000 (UTC) Received: from localhost ([::1]:35961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT9rg-0004eW-8h for patchwork-qemu-devel@patchwork.kernel.org; Wed, 13 Jun 2018 13:47:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT9pF-0003LF-IS for qemu-devel@nongnu.org; Wed, 13 Jun 2018 13:44:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fT9pE-00075g-HG for qemu-devel@nongnu.org; Wed, 13 Jun 2018 13:44:53 -0400 Received: from mail-eopbgr10138.outbound.protection.outlook.com ([40.107.1.138]:47432 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fT9pE-0006sA-8F; Wed, 13 Jun 2018 13:44:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UHgzfHYlMbyk5Bo1miEXBGJ97bmZHE2eX7x6Ly3MZgo=; b=Z+qOQz3ebVq7UQw2je23n2++st0Ude7myrwWsGtjcp0O+ih+tL5hNag6+Jh/PJSnU4WxFM+SKEcmAvj3jDB4BolGGFNHPBx1i9ODgB0HTKaLK40a16QvXboqoTiaSZ0Y5A8cnj/etH2YODkKpHavao2nd+5MkQOVhFjVbm4c7KY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Wed, 13 Jun 2018 17:44:49 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Wed, 13 Jun 2018 20:44:22 +0300 Message-Id: <1528911866-37489-5-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528911866-37489-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1528911866-37489-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0902CA0023.eurprd09.prod.outlook.com (2603:10a6:3:e5::33) To AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 084237d8-61d2-4b6d-1bed-08d5d1555cbd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3347; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 3:VToX6Aic9lKmsL3+7s5JQvg9wt5Lo4sEzeXWtSYmouczfsnSeDvUn1d4Qkjb6+anM0/lL0Yx6Enb1JT4NGKlBjtNIPvjG30N2BVmvuvRKortHDYvUyYprqfvPYpSbhBTYLy0/Rom3h4YoWemVO3Qg49GCcftAIigCU1cxOxb5e1hQuLJXCpsISdu8BDsdQSQslVA8+Q+1pqJnGRfpixR8U9asZ7hQfOqJwaYCD6Okry/Pn+BNKxPBRklDOf6cBPv; 25:pBfoZD61TTBuXXTrNs4JCY+oF5d+OfV8bFFFU3qt1CMQWNiTg4Exry504hfYxbTEwzR8VBpSsufDTizrp4VUi/WX/JLIKvFdMCTWlZPpWPUKqcymU97ysav1HeauWNjZebOVkPQsmVAtoKTDG77EDctxcX5kGF0SptHjUgaibiFQbn5XWB0fbTtaTsElxiROXbEfUmQ+b3RYeZ6Rdruy2shNsequHkOVB4NtefGBEW+vIwYFteHVKAPz4PebjUwm+KvRg8q0K+qofo5OcEP76yPpDED2RkbTSDsWDTOa3xx04Ke025sKoQd6Z7n5mmU2oJLsPQIEkCuAKPIGFLaDlQ==; 31:oSxAC7m6V8dVGMwJ4djIe22ysJCRXeo9Ukz+ke5kFqO9msZvd0ai6mAQ7KqEzcGaj9bFl6phyfHAkml44xlm+CRL/RZOr+DzmfUlQjznYz/sBYSuXspEbK35oHkF9n2swSnxynmVnWCO+dn7zwaocdXhbGY+I3cQXA3Uiz1gjg+/T+ULcmqMOqqGwaL1BW6v7yluYodERi8i4AnqKAUMqV2od6cweMeaABywdmeLjWc= X-MS-TrafficTypeDiagnostic: AM0PR08MB3347: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 20:0azQ8Lqddpz3Z5U61rnz4EEQLGKCvRVyTp4LV/qazfQoEtuYrW4MO6Hw0d0ZNPqQTwD84XOaQlQ3lh3YPLwXyME9nU9NQ0yWxfjtv3pXLcUuKvc2Z5ay7YZ966H8MjVRCHnlMbV22+U4ukQOVY4pFGCAncK8XR+y9+L8Ozib7R2bT8qED3gwksd0+LjPZMQf/hle4et2UzzIyk0D969828wjcp8SK6kJhqmMSvZR6AruDS9VSdgLY1Iy1FRGUW9iwDnLcQefmsh8L2ifmqbD046tb+lfzHPQCZYZKwQj8qUv4MnHebGFraktZP+OAuQMks/GWqME+RjYPMaSIirXSI9H95MOgE0WV7YJYWaUD0JjZRYn0y/Tawac+WHNYbljxzZSfmBN3LapKRjCirOTvtZf91hOHqaa6TjV1tuxyr7E2JCCpae+IoqYxasMnkMwYTSyB6tuN4Rio65QG/0DROWeuEsgc4bG8chJRBdzVaRKTGh364SJfWBkfSbcfYfD; 4:OBPRWIL04+wvZ/PMcyfZpCF3/qWyzgj28ZO5gUK8E47imsEW4hA1yIRwqYzTxiKi16S64raQLTC8w3Khw438vDc225iK9qCWUmJat2SQK0YEcKOxgxMC5Bk6YZbUjM4Q0f7Zx2cwyYBLRgAuzsxs+W+fRnxyH/lmhEuePNFCJMLSe0w9Hp5m8KtX2Cifzgj0kDWvBXvfqec4NruJRIlVMsOhZsO4jb6jHxmt+cwfH/udiOzIMyu8TZspPLHo4y+g0udS/YN7yfy6p8Dc3/GwoQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:AM0PR08MB3347; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3347; X-Forefront-PRVS: 07025866F6 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(346002)(376002)(39850400004)(366004)(39380400002)(199004)(189003)(50466002)(2351001)(386003)(4326008)(2361001)(6512007)(52116002)(105586002)(486006)(478600001)(106356001)(44832011)(53416004)(107886003)(51416003)(53936002)(76176011)(11346002)(956004)(446003)(2616005)(476003)(69596002)(6486002)(48376002)(16526019)(6506007)(7736002)(97736004)(186003)(5660300001)(6666003)(25786009)(6916009)(305945005)(8936002)(6116002)(3846002)(50226002)(66066001)(36756003)(8676002)(86362001)(47776003)(55236004)(68736007)(316002)(2906002)(16586007)(81166006)(26005)(81156014); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3347; H:xantnef-ws.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3347; 23:pb0MSxFGk0eyeBXnp2qEvq1qtiZlUSfsmOCoWywGa?= =?us-ascii?Q?Od2F2CGbsxspqJ/a0CVPlg6dDJwYKyeIuaTg+eFYWv6FhhDS3agE4AtARPJY?= =?us-ascii?Q?2KlJS1Fy9F1RNk29uD8CNRizxYbuevREVZ1YS9XhLQ8ntKpXiH6BGDGV4E//?= =?us-ascii?Q?rvawRMHYDhySoT6Mg497HvGl8eDjJ1UGq0XXikIg0ppYBJzfY9P7X16Qp6vd?= =?us-ascii?Q?istlMRRVFHIUHyk6sbpU4AwQ0hQAxtOGvaANkra/9bpE4pvxwHO2s+7O6N/c?= =?us-ascii?Q?+x/Z2+/0xwZzDBGEXit92zTq00Gvyj6jHdgCRwV7lrVq3oXMbtJf+JWX9Ogt?= =?us-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jREtuPP0pMcyzM2s/Hd2KWAaPCFDB1WYoeVrsbCUOVeMHuTUhboZWr2UYu8uaghYryc+u4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 7:s7Am49unhUVFqgIpui6dbg9xxi853Be+ccml//bp0QWl0s6qtCCCR63sEAPJ13IE/l7nmdg5eFXSuDc6Ksc/q/P5eJoX4NY2/+OqfX72J1LmXgstIJHSrjxXRm9Nyvkg6PE4DiRUrzYN4pMcBGB3nGqyiD9WNmsyINrkKhkz02BVgbuQhbYxQJk0dPOtITSZVshbWfTtq3WR+7w9Jvo3fHuW9j9UV5vSx26FDWgk+FJRani6tJQZ+S32lTM3ouzZ; 20:gAl7qvtdfPNVGIngzlHiM5LBeHxgQN0wtVAOAppdwFAx07QjcM454OHo4VxxBJ4SBQp/R690gu7HbMiz28IalibdeFk2dnlHDC+w+biHDzwndFvBAt2U3e9PMIZ1NJbo11HIn8dWO7JnHLYVovvGPsOjN70Hl+u4cNzKgHGhJ0A= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2018 17:44:49.3510 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 084237d8-61d2-4b6d-1bed-08d5d1555cbd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3347 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.1.138 Subject: [Qemu-devel] [PATCH v3 4/8] scsi: store unmap offset and nb_sectors in request struct X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, Anton Nefedov , berto@igalia.com, den@virtuozzo.com, qemu-block@nongnu.org, armbru@redhat.com, mreitz@redhat.com, pbonzini@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP it allows to report it in the error handler Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- hw/scsi/scsi-disk.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index ded23d3..b08ce8a 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -1642,8 +1642,6 @@ static void scsi_unmap_complete_noio(UnmapCBData *data, int ret) { SCSIDiskReq *r = data->r; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); - uint64_t sector_num; - uint32_t nb_sectors; assert(r->req.aiocb == NULL); if (scsi_disk_req_check_error(r, ret, false)) { @@ -1651,16 +1649,16 @@ static void scsi_unmap_complete_noio(UnmapCBData *data, int ret) } if (data->count > 0) { - sector_num = ldq_be_p(&data->inbuf[0]); - nb_sectors = ldl_be_p(&data->inbuf[8]) & 0xffffffffULL; - if (!check_lba_range(s, sector_num, nb_sectors)) { + r->sector = ldq_be_p(&data->inbuf[0]); + r->sector_count = ldl_be_p(&data->inbuf[8]) & 0xffffffffULL; + if (!check_lba_range(s, r->sector, r->sector_count)) { scsi_check_condition(r, SENSE_CODE(LBA_OUT_OF_RANGE)); goto done; } r->req.aiocb = blk_aio_pdiscard(s->qdev.conf.blk, - sector_num * s->qdev.blocksize, - nb_sectors * s->qdev.blocksize, + r->sector * s->qdev.blocksize, + r->sector_count * s->qdev.blocksize, scsi_unmap_complete, data); data->count--; data->inbuf += 16;