Message ID | 20170501175314.10922-3-damien.lemoal@wdc.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-block-owner@kernel.org> 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 0F2C7602B5 for <patchwork-linux-block@patchwork.kernel.org>; Mon, 1 May 2017 17:53:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0469F208C2 for <patchwork-linux-block@patchwork.kernel.org>; Mon, 1 May 2017 17:53:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED6F42808F; Mon, 1 May 2017 17:53:47 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI 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 7EF2E208C2 for <patchwork-linux-block@patchwork.kernel.org>; Mon, 1 May 2017 17:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750720AbdEARxr (ORCPT <rfc822;patchwork-linux-block@patchwork.kernel.org>); Mon, 1 May 2017 13:53:47 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:9617 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703AbdEARxq (ORCPT <rfc822; linux-block@vger.kernel.org>); Mon, 1 May 2017 13:53:46 -0400 X-IronPort-AV: E=Sophos;i="5.37,401,1488816000"; d="scan'208";a="14484649" Received: from mail-bl2nam02lp0087.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([207.46.163.87]) by ob1.hgst.iphmx.com with ESMTP; 02 May 2017 01:53:45 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=MzI8RX45ITRDzANc8rPplIrVTgr58T+E0n3ACYzRVNw=; b=gO7kRuSW90U9DelgabV9jhuWVd0byJ6/AxNriWBexTRwTKB3IUQtBRPNtGphlWernHLIjiDeGLIKzAeRm+sX26X8xZjDtobtkZFdJb4BU/aCiTJK6v1iSVlxM++zxeEwaQF1993eah4es63m5tiyVowGy3ST1bZjcegRakiQo1A= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none; redhat.com; dmarc=none action=none header.from=wdc.com; Received: from washi.fujisawa.hgst.com (199.255.44.173) by BL2PR04MB1971.namprd04.prod.outlook.com (10.167.97.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Mon, 1 May 2017 17:53:40 +0000 From: damien.lemoal@wdc.com To: dm-devel@redhat.com, Mike Snitzer <snitzer@redhat.com>, Alasdair Kergon <agk@redhat.com> Cc: Hannes Reinecke <hare@suse.de>, Christoph Hellwig <hch@lst.de>, Bart Van Assche <Bart.VanAssche@sandisk.com>, linux-block@vger.kernel.org, Damien Le Moal <damien.lemoal@wdc.com> Subject: [PATCH v2 02/10] dm-table: Check device area zone alignment Date: Tue, 2 May 2017 02:53:06 +0900 Message-Id: <20170501175314.10922-3-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170501175314.10922-1-damien.lemoal@wdc.com> References: <20170501175314.10922-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [199.255.44.173] X-ClientProxiedBy: BN6PR1301CA0002.namprd13.prod.outlook.com (10.174.84.143) To BL2PR04MB1971.namprd04.prod.outlook.com (10.167.97.143) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 138ca26e-e66a-4a73-2b84-08d490bb0170 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:BL2PR04MB1971; X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1971; 3:UDvzo5lA2GW+ZBx63XyKts2PSvZlT100SAcMpDSzBUGq1BnvnV6obal8kyKBPOBKsz76+qLT4Ed+AxniZLsy/OyMV3uxXGohYFN1T5FQznap6k5KjQDo+1Jp+V9qvfg0+iQ6HPSA/JfLs7lmiEhR80l0r2+Tu3qqv64fAZYoATwRtjE6xw+KOqqksySfR/Yhc3XNd6b/b/ufOj5VjxgFqXnu3/8CGXJ0XW+ThEWixUu2e6ZJKz2H9dp1EwzBMF8WhGnqYA0SNsyK20oESqqSxSjst6FGQJWPYK1wrjG32LwC06AuaT1HVC3Nlie/YyDbheELx5/yR96MxsPKSVsKD6PZGVfcslkxZXhiJE7g74A=; 25:kGOG7Z16f2wApvZoD1SsexRTebIOEcKiLdHBADuz6+nLGxGZlR6VdkwNPjhxT5U3676bfp0G6vM4BKtxUbs16V6h1DVbJ2tW0IeWbRDgxE9DZd2kyy5I5QBcxNwaxt64dsMVg3r+WNmDS5VI2IzIPl464nFuNW+p1ONnGqqJ0BdmOD6mcy0cw+qbfawTEItaAbhkabcU7FxKD6NwkOSaHyjbYsUFn/3XLPRtAUnYCULnONrv1EeVinF3IU3/W8kmZShXGTu0dmCc2gVZYzsZHGTdttP0dzgK4r2oZAxruNZ9DjZGYmf03yqsbQ1U++dWUjRw1ljuNaFLSWM5eGU8Qhj5SRvWD2Fh3+yXXD4yKkqj+0RQIrZc8M4vGyRvrQUq+ZRHCEn8Ld2tYPmvBMtoNIlrzmJACKmHdzPA76CKz1xr97f3WJJ9iY2twp5/l+Y8pw8uaav29HL8I8/y+R6l5g== X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1971; 31:UeHHdbVfneOiOI17/JkdaV7qycdXnLwVztEqZbzwkGsuH8MnVDbLlevEGvGgs+HYRXj/Pa4Hx4ZoLVfgsdqD69duFgrUKXDovdqozFtvqw+RcivNcQCDuFELwjaegv9D5g1kEgmPiK+czkvHuh6hcEcRn2rVH7EW2uzMjeOBwqlGhIk2nvMoCE7LFdNdIxTMVc973NWUAjQGD8fenX54KlKLBaM7vyaahCUWzICkycE=; 20:8vekARw/MLzWl6X3TujYhyRt9XS1Oj7Pv9GJKRqUYvV1UEvX0XdYgu3WxfGlIHxUJHqdVJDRhYo0a6ID/XPbFT2H/ctPfwOBLdEbVVmCi0zFYy61d7Vgao5+DKCJ+g9maTwVH+mxbMJJDgXNzihrHBgNSCSEAzG1d4uICr2RnAkriYAqJE14K49whilygXKWVN54Ws4bApUKfx/zDfCJTT3IEf9hKfbRPr/GPLh3x+MHA7MmG5ovZ/7C5Xc04Gliu6eAZVd8A8coB0P5iQMmpFUuDk4M5gHBOXEl4h4hpZUmm4Z7RdjVkH+z5wNVFaBkgMH620jZzspciJP8tczVgHCzPCaFW42H6ODMuh928jNZvvyGvLG/jbp0Etl6+Tsf+P+M8xd6ayQp0yvIDb8Ejtv8M2oY2jgG1N8TrkrOYQmc5GdxciDMpGrwCrt3GnpFTx3lgQiXBoz7oVr/Gs0lptmFWssXQWCOFplcxobscWnk3biqzLq0FnnlwkToN3bf WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Antispam-PRVS: <BL2PR04MB1971E2E5B6F403B168E9E777E7140@BL2PR04MB1971.namprd04.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123555025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(6072148); SRVR:BL2PR04MB1971; BCL:0; PCL:0; RULEID:; SRVR:BL2PR04MB1971; X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1971; 4:d5mIrC+RNTjlPWaUORkPDxxowwXN+janeFgB9DAuljO3INyUwjmvJ5CTq4j0sY6ayAf5NbV5U+FOkaI4vgo0DwGa+KnGjCvYb313rrYBeqexXaV1uFAD0hjcGaI6ZbJmBtuLRmIphJeGyveK7gW/mNn9o5q1Owl0GaMRIi2/8UvM6f7+tgzUz/C4ZZsTsaXnKyPvkrwq8MnfzZMtih/O6ZKLJ6/BNx2nQhoDou9RysxgFe3y3H4TB0rSU09pTn9kY5GgCDUdRVB6JXcZuDQHuNGsVh+M2+rvoQqXwuX08x5de/MYTvcOKF1L1CSBxEVaAJcqvPmAiZ9JOGJd+52SYkZpFW1SxqL6tu3hioFR3lWYlMHH/IZnHQK2yrYPE5O1Viu0m7R0xECAUy2iX0Aeeuyqmh6YXwISKo/tgmXDxYt91GBOa0lmzkVWYWO6myZxSjf+0+6yRvIe2iNLXW9BglciV77y9hn9SqpqwPYUPpezbRKrkozs6bgVuQI6FNigMNVQhbwSYneLQ0710NXN0s9ar2GG58nqhzo7ejPBp41hQFaDRAh6g9jTmmdnx8YJkXP/3V7VZc9Rvvd4q6vbylTeh6e7J/Arxko/lqnyPJQiZwVAnW9pGDItGJuCxEsDs+XBki0eZUnhjl6W9DwDr/6/QWy9DVyyOAhngL0FWb2z61MFcFZX+v1LSjUx+0sGvxYQi58vg1jkNx3NgZOnfmsBYNJ14zCSvw0rLWwtxRw= X-Forefront-PRVS: 02945962BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39840400002)(39860400002)(39400400002)(39410400002)(39850400002)(2950100002)(47776003)(50226002)(85782001)(25786009)(42186005)(7736002)(5660300001)(6636002)(305945005)(81166006)(6116002)(3846002)(8676002)(33646002)(54906002)(6666003)(53936002)(6486002)(9686003)(189998001)(6512007)(86362001)(575784001)(1076002)(50466002)(2906002)(38730400002)(48376002)(4326008)(36756003)(76176999)(508600001)(50986999)(85772001); DIR:OUT; SFP:1102; SCL:1; SRVR:BL2PR04MB1971; H:washi.fujisawa.hgst.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR04MB1971; 23:a47+o5RF8QG2K+UqaH9vEFHmsk4I1tuT4J2qD1di4?= =?us-ascii?Q?jiiPF77stjcRMk03zmekbk8qZNtSnhA/ey29gSpvJSJQZqn6XbDWw/12Z5HO?= =?us-ascii?Q?gAKfbEoA/hQuoL41/BjZiw57LNkx7XcZekRMYC+tULkdtH+qMf6HXJnb+s20?= =?us-ascii?Q?EH3XFB93VBHoO5d0ket41mhQwW6XZydvIYXTwiOYPpDWhmPZzZpr2Z66CCJp?= =?us-ascii?Q?zvI+IJLLOisGCfiIb3eleDgmo9Lj1/omyCVh/nW72i/vy84gVqzlWOSbTNyt?= =?us-ascii?Q?GrZv7CdzwBMyB8+g+B6k4Sra73FqjDkdVfEJ0GzYeC6RnQFqxZdRwYyWk825?= =?us-ascii?Q?B9XqrU6SdFc2gzBP9J9nT88eQ3eYmn0NcURx/VV2CjdYME7I8YNWFu/SBs5C?= =?us-ascii?Q?LuM1mxQZakAy0qji7+5LQqlmS0y2exALCZsmK6C6wnWqkNLQ3hUCnvpHEuln?= =?us-ascii?Q?ejT5zpM3WZmXzV1VN69kxTFN40CbCkvuSwsV1DH1BxaBfLyeLLXfhbP8I4N2?= =?us-ascii?Q?AfMT/QoIg+9Fbk9hs2jLft/BcUHiqWPPyRBzhVNTONtpL2LhdK9couBmuu5E?= =?us-ascii?Q?EyQv1e/Qox4u2jhBhJ+w5qvkiRFvOCmomwHWzmqM4URhNH3zR7D6VmGos5OJ?= =?us-ascii?Q?z+j9vgnrO0Ka96DaN4S9Yjwtprd2T9So327hYHCJ7hQ9mdCZZwTIBPPVKWtB?= =?us-ascii?Q?wcVUafjQAljR1V0spJ1z+8mgTmrhewESWkSHGdhnzV1bqE+f9tlV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F69oQweDIN0eeqOW28tXkS8UhPl4by0BA/yRaBmpPC2Sv/Llkp8dWQNip0zlLX50C+nsBMA8NIcfYA93sm65UiuMc3nkkN072HyZJ+CC8zYRSisDqVoWSU=; 24:fDygFPdmHRrkDVUE4srE/fIIdzUua5vni+8p6yglD5XqJnOb3DDVqtvAmuzxXZMtcK+gToCLrM6McGdaBmqntJd1Zio7vnIjONRjS/IIxog= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BL2PR04MB1971; 7:XioETFm2WBcgwbPjlciXCdeAZOSKax6pJ6Ec3Nj100oz9CeZ8mrOsBLoKnrBLqOiwe6PNeab3Dz8XFSa1b1ATTUAs0FVrMD4ZCONXkIHvpAwakj7DOxW/KRnorV5oLcjAC46sDTfyuyTA9GjQe/igdCf8d9RMQPDLvahodoIq5Xn8vqdyyBKeqQhlJuNsxnPvRPapnuAtsnqDa+UAI8S1Ll5kJ9VT7PPHuMNipSQgam0ZeE2CtSgYGm4pTpfCM7Hrj01jPzScREJveEgPGgOZrYfa3VBClI2DNw5KKNQwHkSyimfKX6fRRAXctx2yyNJ6SM3eYSlaxIOgQFlqUXo4A==; 20:5n4sIAu97s8czy4Dn4tRFoZac3CO0dMaj14AzgUok/A+hazu8TYOFDm5X0z2df3VBePGFGHOPLoHx2/4VpTIWpS4l1J3rwlnw3CmnebCSxc2yDkMxNuzVmR2URXkph1lNVQ5vn3u4BqSHYPtfn4ThzK9UrnpBzfOxQ8LQ+IFoKE= X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2017 17:53:40.2568 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR04MB1971 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: <linux-block.vger.kernel.org> X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 06d3b7b..6947f0f 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -339,6 +339,33 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev, return 1; } + /* + * If the target is mapped to a zoned block device, check + * that the device zones are not partially mapped. + */ + if (bdev_zoned_model(bdev) != BLK_ZONED_NONE) { + unsigned int zone_sectors = bdev_zone_sectors(bdev); + + if (start & (zone_sectors - 1)) { + DMWARN("%s: start=%llu not aligned to h/w " + "zone size %u of %s", + dm_device_name(ti->table->md), + (unsigned long long)start, + zone_sectors, bdevname(bdev, b)); + return 1; + } + + if (start + len < dev_size && + len & (zone_sectors - 1)) { + DMWARN("%s: len=%llu not aligned to h/w " + "zone size %u of %s", + dm_device_name(ti->table->md), + (unsigned long long)start, + zone_sectors, bdevname(bdev, b)); + return 1; + } + } + return 0; }