From patchwork Thu Dec 17 11:43:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 7872241 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 132D0BEEE5 for ; Thu, 17 Dec 2015 11:43:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCDBF20416 for ; Thu, 17 Dec 2015 11:43:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 939F2203F1 for ; Thu, 17 Dec 2015 11:43:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934515AbbLQLnX (ORCPT ); Thu, 17 Dec 2015 06:43:23 -0500 Received: from mail-bn1bon0088.outbound.protection.outlook.com ([157.56.111.88]:25126 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934504AbbLQLnT (ORCPT ); Thu, 17 Dec 2015 06:43:19 -0500 Received: from BY2PR02CA0109.namprd02.prod.outlook.com (10.163.44.163) by BY2PR02MB297.namprd02.prod.outlook.com (10.141.140.17) with Microsoft SMTP Server (TLS) id 15.1.355.16; Thu, 17 Dec 2015 11:43:17 +0000 Received: from BN1BFFO11FD045.protection.gbl (2a01:111:f400:7c10::1:103) by BY2PR02CA0109.outlook.office365.com (2a01:111:e400:5261::35) with Microsoft SMTP Server (TLS) id 15.1.361.13 via Frontend Transport; Thu, 17 Dec 2015 11:43:17 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; fb.com; dkim=none (message not signed) header.d=none;fb.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.173) by BN1BFFO11FD045.mail.protection.outlook.com (10.58.145.0) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Thu, 17 Dec 2015 11:43:16 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id EE.99.32178.4DF92765; Thu, 17 Dec 2015 03:43:16 -0800 (PST) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.248.2; Thu, 17 Dec 2015 03:43:16 -0800 X-AuditID: ac160a69-f79f76d000007db2-b8-56729fd48b51 Received: from [10.50.231.72] ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id A7.F0.17166.1DF92765; Thu, 17 Dec 2015 03:43:15 -0800 (PST) Subject: [PATCH 6/6] brd: Accept non-aligned discard requests with size zero To: Jens Axboe References: <56729ECF.50906@sandisk.com> CC: Jan Kara , Christoph Hellwig , Mike Snitzer , "Martin K. Petersen" , Dmitry Monakhov , "linux-block@vger.kernel.org" , device-mapper development From: Bart Van Assche Message-ID: <56729FD0.3070309@sandisk.com> Date: Thu, 17 Dec 2015 12:43:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <56729ECF.50906@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprBIsWRmVeSWpSXmKPExsWyRoxnke6V+UVhBvvesVj833OMzWLvu9ms FidmelqsXH2UyWL29GYmi723tC2WH//HZNG28SujA4fHxOZ37B67bzaweUw6/JnJ4+PTWywe 7/ddZfM4s+AIu8fnTXIB7FFcNim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aX2P52DvMERv5ZSFpmISmbhaRsASPzKkax3Myc 4tz0zAJDI73ixLyUzOJsveT83E2M4DDnjNrBeH2i+SFGJg5OqQZG1qzmkjV+zsviHki+aT01 0XtH8yXOyszpzNEBZ70zuu9GV/nfFCnpqF3a3z1D++HzmYdvZkydN6Nkl5iY5DHZyRtubHk2 NW8z+44Jzzj05l/PelngdnU2Y4HprIyz2jnzJqVOTsnibiqJmCnIIX1Dxjs2qLh4fm7IDdfE F8tOMnx72uH1cVqxEktxRqKhFnNRcSIAuvyORiMCAAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD045; 1:rqxTQTiaRuc25x63I1zeLOEb2mXk++qDdKNEnImCzAAyg0JU1QSVeg9m7BXG2tCV/Kok46bsEzpLOrnPytaV2A4Yt9okrbT0+P/wP+pk63xOqgJ1jJbAYELw72zxZJv7cndai9ZHGD6XgYnzwjpa2Xt0BcHuTjGeSIb44kL3cNt+ccBXAtTyilwQCuFE1bOxK7D5A2IInK3oPCPhZYlcYZGIWWvpx5lcEymyFCSKVGwMddTA44fyptDi+5MwxyOTB4nM7eJeTmxN5MAMljW0S4/dDMSEKEulQ3Ha/ams8XGGPpy++BZj3X8+5bvkupHCFKMr2IUSsu0g2WZRljadxw== X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(81156007)(586003)(50466002)(65806001)(83506001)(69596002)(19580395003)(59896002)(575784001)(86362001)(19580405001)(65956001)(80316001)(54356999)(76176999)(229853001)(87266999)(47776003)(97736004)(5001960100002)(4001350100001)(110136002)(189998001)(11100500001)(230700001)(23676002)(1220700001)(1096002)(87936001)(5008740100001)(77096005)(50986999)(2950100001)(92566002)(33656002)(64126003)(65816999)(99136001)(36756003)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB297; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB297; 2:pD22siDz/dTWy8QUwS3IvJIeGbscoKG5A+UFACH/mtdxV27/CGLf+0FuSwZO+CF3vZTwJ+IH0tuy6Eg73izxX2I0A1NrjufJor8ovc+4hAyAvmvj0EUJAng+t9KbXuhhDBD1jTXsnCGA4DCMfFWnPA==; 3:rbNHrzUjAe3TdGJf5YnKfcDbzwoKjJF8832XNoYcyFSdZKY0Qzy6m/4DB5r5zKGOrPsrtM14I7poqE242cW64XcnJrd/KVh3i03atj1FuLgzvH4cS9XfxlQxcAdMukcEGOiKeuJvl/U1Ak1BxlPcXTKaSV2dNAX5ztoFCLRDfdPoOL5JHtd/26fY3QZt1ztPXX4ZoVg7QCZ00iogF1J3cnivhWHwdNelg4Dbt7djG83KZoFWp4wQ2P3VCDd88+PFkXQWNBKc2bTCTmOpUQP6eQ==; 25:3e4BY453llAVB5AJNf0vjKwU4nxXOzCfUznX6We/amaZN3UeYd0VQenii21JC+WRETaItXm5DpBj8t+oXtjISxiMknCSgfQ/mRIvhLPGjCpIFyrqHveHeZDhDhATtWLS5BvbUpFyLOfjiaaI2qAGfPNbuLobu+P1LJlAnSwGVis+q9fOodDalIWZSZO/Qz+JOFlLkk1DALyAoeBuwIni6GiMevRXjoMbRpmD7Osr8+uJ61qsLdgnk87VNJV/Y6Jx X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:BY2PR02MB297; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB297; 20:0jQEgaXy8Z2jT5Sm37KlDk++tI34mR6IuvPmWj/mbl693aT2O2NWzNQIQMh0d7mMP5vQhcxwZHw1WgqKU1Dd5D4IAeu62rj3ohq8ubEMRUN+JDi4ip9vfKzyld/M+jL20PtstoQixdiErQXgq1EoIhIqgDH1GdROx5RciYISWk8PtOM9XsXs+fBc+UWcz4nu4RR7sIDsgekI1G68ZbCdQLkyosGTLicvS0OAlfDVo+wUF1pequvabkEuKzU0kxHZh+chGen6p8gVF79Mh6OKVbKz5CV1/IhnTfhSUqNfkH/bVX6CMj6l0gp/EmWalZblVIdSt5O4GTRd4dLPEAcm5zhQnEisrWAezx11GnjDB7ByNaPo88kyAgvHXVK1JzbySMx1QjE4DRcJoZVIltEQLpTtf+bEY5MreuVjOWvGU3WE0zFb+sh4Te09Pn3BVkMNlAeUzujYvzMW8cpqoLwzskMsGRWaFXgmadiyBMEAdxlb/qvDjygxmCWnns67pHc0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(146099531331640)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001)(10201501046); SRVR:BY2PR02MB297; BCL:0; PCL:0; RULEID:; SRVR:BY2PR02MB297; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB297; 4:3DW8othx2XD/qO4L6w9xL5UZZq8JY6dmTNCDcl8lmsvFahRFnB0Ad2SdvcpxACB0AwONLlP4l0IIK88Xb1A2YWkvCIisxIDxiHNOjLXaDfB7YcXpBNgAlypURI/zQtwWs5p6MFFpThyoUq6VQRIdIHIMy3/OKQPVnFziml9vDme1BkRvXCPZYq14S0ELi0Ecp+2x1yYbGHMiwcB/WTqvYfb2+S7fxXFsTiczfuEqWkhK0m+LkNHdcqwSUA/YPgN4mb31Rh8FqU5daKokZGyrAyeAgXQeUCkWXtjdDAdSF69xNrjsVuh8xK8v2d7nnT86gLR/vrjawnO6M1StiDhASLmWaxAkA8n5Td+pKyPqK/ppH4hZGN2VRpWau7oHz934U9raSwY/ko65hKuy8KgNE/xatejGq9S3uNmzwQyCEZ2VwIVdJfRVuS5MsK4qjtmyRn4NbbaNx0QXM+bVC5Isfw== X-Forefront-PRVS: 07935ACF08 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjAyTUIyOTc7MjM6cUsvZ2MzVzkvOTZ5eT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6eg0aVUmN0/SjChx8OdXDHJ9MMQhVuv/wlKoI=; 20:EzJHPNYJ1xkWstSQ/WiGN5NOHLXHyL1OK/5mjaNJYtrTchjb5IXAYYsiwJtUkU0KXvpkO0pODEX5+6nMqWMl9e+FE6jU0UFd4SWKFpbG3PNd5zBWIv5/pNTeVfL2auqrX8afSf57sZSbmK3M0Mo57agJJOjp3HOkI62owdGRC/u32hYgJ4ZiVIVyvZF667iPQts1todJ/xR1sL3BqGe4syZP5JccFQvb8SqP8Ff3BOvLztzbMA+EM2QvduEopsmU SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2015 11:43:16.2080 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.173]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB297 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Bart Van Assche Cc: Jan Kara Cc: Christoph Hellwig Cc: Mike Snitzer Cc: Martin K. Petersen Cc: Dmitry Monakhov --- drivers/block/brd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/block/brd.c b/drivers/block/brd.c index 7e0a54e..a757c7b 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -339,8 +339,9 @@ static blk_qc_t brd_make_request(struct request_queue *q, struct bio *bio) blk_queue_split(q, &bio, q->bio_split); if (unlikely(bio->bi_rw & REQ_DISCARD)) { - if (sector & ((PAGE_SIZE >> SECTOR_SHIFT) - 1) || - bio->bi_iter.bi_size & ~PAGE_MASK) + if (bio->bi_iter.bi_size && + (sector & ((PAGE_SIZE >> SECTOR_SHIFT) - 1) || + bio->bi_iter.bi_size & ~PAGE_MASK)) goto io_error; discard_from_brd(brd, sector, bio->bi_iter.bi_size); goto out;