From patchwork Thu Dec 1 02:38:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9455295 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 1B1E16071E for ; Thu, 1 Dec 2016 02:39:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03E7D28450 for ; Thu, 1 Dec 2016 02:39:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC64828471; Thu, 1 Dec 2016 02:39:21 +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 439E228450 for ; Thu, 1 Dec 2016 02:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752576AbcLACjT (ORCPT ); Wed, 30 Nov 2016 21:39:19 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:57499 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751080AbcLACjR (ORCPT ); Wed, 30 Nov 2016 21:39:17 -0500 X-IronPort-AV: E=Sophos;i="5.31,723,1473091200"; d="scan'";a="38260769" Received: from mail-sn1nam02lp0023.outbound.protection.outlook.com (HELO NAM02-SN1-obe.outbound.protection.outlook.com) ([216.32.180.23]) by ob1.hgst.iphmx.com with ESMTP; 01 Dec 2016 10:38:23 +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=D0EiZzpO28lyrTofNa8IiwFt8LEwSHgajHMWO+zaRlQ=; b=AYVywj00MKdYxhB/RBN1MWKEkDkLXpxTD9iGVRMbOUtHx3p3ajF1MR5+l/mFme/GOPI3OKQ+NPxqZ7MLACjyrTVYYwWq3mj00yXO8AdtlvPSzbopElwGJh53JTzVleOSAciIWtvtPkKZyTp0UyJ23lAzWbOOWRXp/o3+SJ53MlU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@wdc.com; Received: from dimac.fujisawa.hgst.com (199.255.44.5) by BY2PR04MB1973.namprd04.prod.outlook.com (10.166.111.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Thu, 1 Dec 2016 02:38:20 +0000 Subject: Re: [PATCH v2] block: Check partition alignment on zoned block devices To: Jens Axboe References: <1480551735-9288-1-git-send-email-damien.lemoal@wdc.com> <08af33a8-8705-788f-3b7e-e88eccbc71e4@kernel.dk> Cc: linux-block@vger.kernel.org, Shaun Tancheff From: Damien Le Moal Organization: Western Digital Message-ID: <778a9799-fed0-3337-e186-2a761cafa0aa@wdc.com> Date: Thu, 1 Dec 2016 11:38:15 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <08af33a8-8705-788f-3b7e-e88eccbc71e4@kernel.dk> X-Originating-IP: [199.255.44.5] X-ClientProxiedBy: DM5PR12CA0009.namprd12.prod.outlook.com (10.172.32.147) To BY2PR04MB1973.namprd04.prod.outlook.com (10.166.111.13) X-MS-Office365-Filtering-Correlation-Id: 24bddbec-9f72-43a8-5677-08d419931d73 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID: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wr0FF3GcBdmAFC0LupWKEhR+/7wwHrPAwm2TZCclTG12cUXTk3Qs3zO3QSGVHuu/46BACn3s4Ovg/E7PXRzQuAxJnwpBt0Y; 20:pXYTgXTgUNSsfdlL82eOggPEHSO6y2Fk2o10JQZ2zWuUke1ZTFpRxdWD0+6vw/V16xWvbfUeWqeboex/7xQMnyWbb+JeS77hrYK99RcSaO7uqbfIMikAMjPO5PZfn1iQXtsfigz2Ufa3SLQoNvQ2JL9nycLYPonWZIwlKKjhlvFZq12sA1NFF7bms3VPUJWMETkFES/wAnM7Ft95kJ//ZPJqTHx8b8hWxsKp/X2JkGqR+vulOVv53iiRbeb8Pw82zO0z9pjtyc9vDg6ZyRJ2sEBDLXmFJLmuGExPUof/7Nqx+A8fFpQF9GCqcK32fr7lsZNX57g9fRtscEJCw+3Ty9taAchEsV5pfFkkZ7P9wwCooHd8mOsbHtwtzzQihSG7tQBwaUH6kvodHQTQWuLkfVtHj0SgCsJhPONFWh6rGtUahlDPdQr5vtVEvrBnZ06d+z0M/hzl3iz4kM0d614UUvkayU23piB3qJMcXw7F5n578oPL17boLTE7PUvrMsWK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625)(67367480688388)(56741022784758); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148); SRVR:BY2PR04MB1973; BCL:0; PCL:0; RULEID:; SRVR:BY2PR04MB1973; X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1973; 4:ynmnnVnA+5lDPuc4Hgg9BLtleyUZHZW+uF4Mn4hSyaQJXN4UZEiRyK4YrzOMqzuEuH+rY295XL91TtJYQTD5dnGuXelA1CUtRXoL5d0rhSkcKYojOGm/Nd/c2QMU1iiPyoI1228qa+yKkaWoNyGH9Lc+ipqj+yAMcFUoUXkaUKuRopnqxHwOBoSYV927suJWTj25IIyUCivzK2l/v/6feSL0AXmJaifoy7d1UHRBEphchBq9K/Q/oqzRniE+2M082RoX07kkJRTzOLwwh0eT5Ee0AGT46KSVDwymlmtsDUNmXQaJ2UCK0DKzHZOWykjuYbQ1RS+AGESFr83JVedlF873weFHuaOl2VOXvZakZC9qOv6mBZa34tI2CYl8JtpuiegjUtdo64MJOBNAsfOxzzrhADumd0BCc5s8vfFkuQlB5MC4qQbQ3NjjeGqCWA27KG0OToaulEz5SP08Rsn5PlbhGnlMNjIAbXUBU/C+SrAz/gbGcYo/Y0GpqJVe/w6Wqeg+HwUlu6yDyFrMFb+fYw6LL3gSlMgqErcMebtUvNMc8uwvAb5BuzNNIXwQkaw5DZPp35GtAgzTYmUa4uF20X6REFUiAapLE/Tdi09zl2/x5tqkuvYMLxR5VAMSHE6vVtdDVGsnHI2SF6ga2ZcLgVwCXuRz/EFgnOpuSriDDzqzArPv/Uew1NbBKer3MT2clAJH3N/LiJuaiIDZYTvNVg== X-Forefront-PRVS: 014304E855 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(377424004)(24454002)(189002)(199003)(101416001)(575784001)(110136003)(81166006)(8676002)(76176999)(50986999)(42186005)(5660300001)(31686004)(65826007)(54356999)(6666003)(65806001)(47776003)(23746002)(65956001)(6916009)(66066001)(106356001)(81156014)(2950100002)(50466002)(189998001)(36756003)(68736007)(33646002)(2906002)(97736004)(92566002)(105586002)(7846002)(7736002)(305945005)(4326007)(4001350100001)(86362001)(15974865002)(6116002)(3846002)(39450400002)(83506001)(38730400001)(6486002)(39410400001)(31696002)(733004)(230700001)(229853002)(64126003)(7099028)(5005270100013)(18886075002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR04MB1973; H:dimac.fujisawa.hgst.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: wdc.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; BY2PR04MB1973; 23:+XEX085BECqWeTPQDf8uplKeMFQnt/e0StPNu?= =?Windows-1252?Q?jTN8QYR8mthq18AGiXi/DwmJIpteLGA9oYBSc2vsa4ueF5ADQdvLuH7A?= =?Windows-1252?Q?Yw71Zc6mLxSlhotrbbykhcFAh++UHsQ/ZppnkLvF4lPEX56nBr7k8nli?= =?Windows-1252?Q?buFyyxOMLiu41rxZuOq7Ole1Ki9FgYmGkgT+0E5Rn3oJhLps9fUx7n3E?= =?Windows-1252?Q?Ng3LK16O0b3ffYhb94lDPjRdaDrjsJ8nfFa3Pgy0dOmudO58V3ZCtvNz?= =?Windows-1252?Q?LGXIaQQ1eAIzO3pBxjNtr6v8Zz6mPNw75AU2PoymiYl6/VtHSUBwpd5i?= =?Windows-1252?Q?HaVFXxK1obI+Os7XH41GOI6ZHP+1ofYrj97oAkY5jwHq37hBS3d0za1W?= =?Windows-1252?Q?bPZLx+s0r/N1oFA2Be/oF9tPj71fOJV038g9j223CJml5Uk7VQibfhiE?= =?Windows-1252?Q?7KNBKZ8yqT3qA+BFd5KajV9i5AAFMjBKcWPWAZy1PkHJ4iQwRG2EYzyM?= =?Windows-1252?Q?IQCrSFanir4ggyfK3JQ5/Q/UxqosSj4Dc9ukOZjMqU3su28FdTwzRgFI?= =?Windows-1252?Q?eWUlZsnrvil1iEi8kSrmosXh9Xy3i1nSDvLvrvdY5pEgJYpG9Ab9Ssus?= =?Windows-1252?Q?4rXinrlQOYPkj36y/g9aku1/KSTrfSPCAtd/HxY7rXActmM58nbbX1SN?= =?Windows-1252?Q?3TeayNd9seE7siyFzK3Sk0ny0kW7AVZj8IHHI50SVuMcS/D7+TVOHC3Q?= =?Windows-1252?Q?LipIVu1Tt2N/G3orhEJAtXRBgATgnOd0KG/cYCCU57gbDA2e4WybZ0bo?= =?Windows-1252?Q?UecinrVWT1yxzv3g7pbvcH2EQGmasPaueO84j0x99ouOSYc8seGSCdyl?= =?Windows-1252?Q?Ua6RsDPs1nK1VzjmixRoJELkct3SxAgcpzD/ro+0OSuwCOvFf7oyJjL2?= =?Windows-1252?Q?JJ5aSYScLeVtfqv4cVnuf3H/bKiSlpulzqICS3T+MfgNEMLZgFN9n+e1?= =?Windows-1252?Q?bEuUkIPXZVQ2ZJKksStESJwOb9+5nArgpZJw1PyPUsnsQNIwry1LnLpD?= =?Windows-1252?Q?ZZ3eStCZaA0Kev62WHMSorBNKlVGVgH3GrfkLC0t8NwDPjR2sxmPMglz?= =?Windows-1252?Q?RsiuAYwqbkgEJb84nxyRsNcI255Lvx4ZnqDXOiKlG0BortHPzfxZWvxO?= =?Windows-1252?Q?FUcxjsmbMiaGqjFSzjhxNCkC4DilaZWCbNz/dOJ8CSqNjlYKKXAbmvDS?= =?Windows-1252?Q?y9Vl8I5HMqNdhuISZIYm0rOGTcqQQyY0I5SOW0ZNDZnT9G5U7NHiV7Eq?= =?Windows-1252?Q?KGro6xfZZD10ovQcloWVBaDHOHNj9SbjiMxbq+JOaBopxuCgWLq4bIj/?= =?Windows-1252?Q?t95PN1ZICo7LAI3CqcSgXDqJ97GeuiWRGZfTA5TcTZ7QJ2fTatEnmqPV?= =?Windows-1252?Q?/bIbbPRkuR2lk9EdiAUIGJVsdhvNg4CCr04Ws7Qe5bEdW+juJa1wVAFb?= =?Windows-1252?Q?xR+JecnobrgpEGDl6V+5G9xO/ysaZ7FL0Yu8MuPjE9AZRLxXAjcAFqxI?= =?Windows-1252?Q?1FuezEuqVYTkf0=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1973; 6:PFDducmkQxP4AZJ1DWfCWHDey8Uomnk5aUJt6FM1NIvXOsFtkUsi6478EjYAWkmnfjqjeJKlFl4Fr0UyrSs7kL6VVNGOmXeVaKtychqewgI5PSAbekgOlr6A6qyW7HWQ4bYVCBcbpK2gFtTSyuahhIAXiBUWU6H2ld61SkBZzByKUgMVG8YkrsTeaKG5XFf8CTgYMKCF7klgHIys1t8YLjt7OHB5B3VOf9w4lRgY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CC5Zi4kb6K+vwu/EMm4jz8sE7M3uecIFzxUqS2ifuDRCKAaURy0dAhZRqk1c24GFdrzdM4BbyGVGvZf3Hfa3Pia37p1eUIBBxEZDGrA+KLNDV9DwN7+fsP6EWxaJ9EQpyJMF+zIdS0ZO4skVdyTkvfoGhvptdEcgHV1LBRDhI4nfTAHYgaZUi70Xy8M+pIVSQNKkqR7cKu8X/KTea6nVoycH0avAZ6Hehe/PZbGh+iG7PCyEKyphioaVXANUfHP X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2016 02:38:20.0959 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR04MB1973 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 Jens, On 12/1/16 10:40, Jens Axboe wrote: > This looks better, thanks. Are the zone sizes mandated by spec to be a > power-of-2? No, the standards allow any zone size, and different sizes for the zones too. However, the sd_zbc code down in the SCSI stack limits support to HM & HA drives that have a power of 2 zone size, with all zones of the same size, except for an eventual smaller last zone (Seagate drives have that). This restriction was necessary so that limits.chunk_sectors can be used to avoid BIO spawning zones. See 89d9475610771b5e5fe1879075f0fc9ba6e3755f: diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c new file mode 100644 index 0000000..16d3fa6 --- /dev/null +++ b/drivers/scsi/sd_zbc.c @@ -0,0 +1,642 @@ +/* + * SCSI Zoned Block commands ... + if (!is_power_of_2(zone_blocks)) { + if (sdkp->first_scan) + sd_printk(KERN_NOTICE, sdkp, + "Devices with non power of 2 zone " + "size are not supported\n"); + return -ENODEV; + } + Martin, Shaun and myself agreed on the restriction. All ZBC/ZAC disks on the market today match these so there are no problems. And it is unlikely that we will ever see weirdly sized SMR drives (customers generally do not want that). Best regards. -- Damien Le Moal, Ph.D. Sr. Manager, System Software Research Group, Western Digital Corporation Damien.LeMoal@wdc.com (+81) 0466-98-3593 (ext. 513593) 1 kirihara-cho, Fujisawa, Kanagawa, 252-0888 Japan www.wdc.com, www.hgst.com -- 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