From patchwork Thu Jan 12 19:33:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chris Valean (Cloudbase Solutions SRL)" X-Patchwork-Id: 9514095 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 400D660476 for ; Thu, 12 Jan 2017 19:33:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C57720700 for ; Thu, 12 Jan 2017 19:33:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20F13281A7; Thu, 12 Jan 2017 19:33:07 +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 AE6E220700 for ; Thu, 12 Jan 2017 19:33:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750755AbdALTdG (ORCPT ); Thu, 12 Jan 2017 14:33:06 -0500 Received: from mail-sn1nam02on0136.outbound.protection.outlook.com ([104.47.36.136]:61120 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750750AbdALTdF (ORCPT ); Thu, 12 Jan 2017 14:33:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8R8u+qzq184Xmx61J7lskeWq7QWPgfbR6h9py4Wbfoo=; b=Tp+K9AUAEeSLFOsjT+cD9u2Hkx80yf08CLUA0I9enTZt43Vp3277IuVNKJTrRDn74knyfZ109/ZgrNDCOWk+KIiEsjRKOqNqQBCb9drjGn/VThJIxrG+PWB1BvVzHc8t0Bm2Ct7CxfHXlUjgzr9tMLKsbFkwkWIhTDCtdeXIFIA= Received: from CY1PR0301MB2089.namprd03.prod.outlook.com (10.164.2.147) by CY4PR03MB2662.namprd03.prod.outlook.com (10.173.43.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Thu, 12 Jan 2017 19:33:01 +0000 Received: from CY1PR0301MB2089.namprd03.prod.outlook.com ([10.164.2.147]) by CY1PR0301MB2089.namprd03.prod.outlook.com ([10.164.2.147]) with mapi id 15.01.0829.019; Thu, 12 Jan 2017 19:33:01 +0000 From: "Chris Valean (Cloudbase Solutions SRL)" To: Christoph Hellwig , Dexuan Cui CC: "linux-block@vger.kernel.org" , KY Srinivasan , Nick Meier , "Alex Ng (LIS)" Subject: RE: [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload" Thread-Topic: [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload" Thread-Index: AQHSbNn5/MnhPqfpGU+Cjkq4moJhVqE0+lkAgAADwoCAAA0RgIAAG7IAgAAUkCA= Date: Thu, 12 Jan 2017 19:33:01 +0000 Message-ID: References: <20170112134412.GB15178@lst.de> <20170112155241.GA18147@lst.de> <20170112181834.GA8808@lst.de> In-Reply-To: <20170112181834.GA8808@lst.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=v-chvale@microsoft.com; x-originating-ip: [188.24.91.2] x-ms-office365-filtering-correlation-id: 10ef9a95-ec08-47d5-b35c-08d43b21d27b x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY4PR03MB2662; x-microsoft-exchange-diagnostics: 1; CY4PR03MB2662; 7:/wt3np+IINNOZqsr6DZCyBA+6Tzd3D9Qs845Fb+L3aawn7hKdZvr6KaV3xpfD+Bdkx4z/HHixX9b1VORo64NFGUgDstlor9fz3IDOIxnr4F/O+T8k0gfYE4kr5eFqALAl+/pN3elKeWnA+8hv2o5yOZNL5H0Q6sBPr9yQOdTF1W4mxhro2huLHual5WhRoV/DlJpUi8Fjfguamp4l3mANom6hODlMlZwfhq/Kq0TRNh4CElqV/XJt9CyWt5WQ4br2TQib8QTLXCwt0kl9NVfseD9uE8+i+0NtdgkBbMEkF7hPwx7nSQFtDqbjmzzHugfNfgtMXJrn+uzSybuloB3kB8P7SriMJbtRv1UFcynu2FkIQENghz8ViteSGGhYmpGYi9yCPtwL3p3u6pu0StHON52gEsNpOcxwG6XyZiOE72xTuf2rWiiJVHy9Omg4Nd08ZbvuUtV2ykR2xRGRKuZZssvFBpCQ5AAYizTEot+ykc= x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148)(6047074); SRVR:CY4PR03MB2662; BCL:0; PCL:0; RULEID:; SRVR:CY4PR03MB2662; x-forefront-prvs: 018577E36E x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(6009001)(7916002)(39450400003)(39840400002)(39410400002)(39850400002)(39860400002)(189002)(377454003)(199003)(13464003)(102836003)(3846002)(122556002)(6116002)(6506006)(77096006)(1511001)(5005710100001)(93886004)(99286003)(7696004)(2900100001)(92566002)(25786008)(55016002)(8990500004)(10290500002)(54906002)(229853002)(6862003)(68736007)(38730400001)(86362001)(86612001)(6436002)(66066001)(5660300001)(81156014)(81166006)(9686003)(3280700002)(6636002)(8936002)(74316002)(4326007)(101416001)(97736004)(5001770100001)(4001430100002)(33656002)(2561002)(10090500001)(2950100002)(3660700001)(2906002)(105586002)(2421001)(76176999)(189998001)(107886002)(54356999)(50986999)(7736002)(106116001)(305945005)(106356001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR03MB2662; H:CY1PR0301MB2089.namprd03.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jan 2017 19:33:01.5402 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2662 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Christoph, Adding Nick and Alex to the thread. We'll give it a try along with Dexuan and update you with the results. Thank you! Chris Valean -----Original Message----- From: Christoph Hellwig [mailto:hch@lst.de] Sent: Thursday, January 12, 2017 8:19 PM To: Dexuan Cui Cc: linux-block@vger.kernel.org; KY Srinivasan ; Chris Valean (Cloudbase Solutions SRL) Subject: Re: [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload" Next try: (I've also dropped most of the Cc list) --- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index c35b6de..2f358f7 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1018,7 +1018,10 @@ static int scsi_init_sgtable(struct request *req, struct scsi_data_buffer *sdb) count = blk_rq_map_sg(req->q, req, sdb->table.sgl); BUG_ON(count > sdb->table.nents); sdb->table.nents = count; - sdb->length = blk_rq_bytes(req); + if (req->rq_flags & RQF_SPECIAL_PAYLOAD) + sdb->length = req->special_vec.bv_len; + else + sdb->length = blk_rq_bytes(req); return BLKPREP_OK; }