Message ID | 20220615101920.329421-9-p.raghav@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-block-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB5BDCCA47B for <linux-block@archiver.kernel.org>; Wed, 15 Jun 2022 10:20:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347005AbiFOKUS (ORCPT <rfc822;linux-block@archiver.kernel.org>); Wed, 15 Jun 2022 06:20:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347596AbiFOKUN (ORCPT <rfc822;linux-block@vger.kernel.org>); Wed, 15 Jun 2022 06:20:13 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 196A84BFF3 for <linux-block@vger.kernel.org>; Wed, 15 Jun 2022 03:19:55 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20220615101953euoutp01f02a63aeba314709eb55ce0c84b82c66~4xAYvC5bY2585525855euoutp01Q for <linux-block@vger.kernel.org>; Wed, 15 Jun 2022 10:19:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20220615101953euoutp01f02a63aeba314709eb55ce0c84b82c66~4xAYvC5bY2585525855euoutp01Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1655288393; bh=bwZDXQMCqMHhu3ZuVm0AocKjdjGbQSZlDWP1ndwgqcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IsnRcezjOXiALz83wEzrvdnlRnY+kZXZoQVFFEWvYvw9evcptXtOsuvwqnMJSYc0P 8IIlnoqCRamVvxdHGftchVRgmOuQt0530yccfh5h8RPRuyp1OqdjjesqSGh4Cl9Ia9 x3jSn9zK07ksmxSos9HsltT1N96m03ezesyOhA6k= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20220615101951eucas1p18d84bd7b38d6657a6c512bd382ceedf6~4xAW0wNp51438314383eucas1p1I; Wed, 15 Jun 2022 10:19:51 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 39.77.10067.742B9A26; Wed, 15 Jun 2022 11:19:51 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220615101951eucas1p238eb45e563bd9645af81bf16c56d98ec~4xAWbmb-F2114221142eucas1p2b; Wed, 15 Jun 2022 10:19:51 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220615101951eusmtrp2c759d4ee173fff60b6c81fb090bf1131~4xAWarPxE0361403614eusmtrp2l; Wed, 15 Jun 2022 10:19:51 +0000 (GMT) X-AuditID: cbfec7f4-dc1ff70000002753-9e-62a9b247678f Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 07.24.09038.742B9A26; Wed, 15 Jun 2022 11:19:51 +0100 (BST) Received: from localhost (unknown [106.210.248.244]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220615101950eusmtip1b23a4a7a289c85a785fe400b913c2e54~4xAVmPX1i1152711527eusmtip1J; Wed, 15 Jun 2022 10:19:50 +0000 (GMT) From: Pankaj Raghav <p.raghav@samsung.com> To: hch@lst.de, snitzer@redhat.com, damien.lemoal@opensource.wdc.com, axboe@kernel.dk Cc: bvanassche@acm.org, linux-kernel@vger.kernel.org, jiangbo.365@bytedance.com, hare@suse.de, pankydev8@gmail.com, dm-devel@redhat.com, jonathan.derrick@linux.dev, gost.dev@samsung.com, dsterba@suse.com, jaegeuk@kernel.org, linux-nvme@lists.infradead.org, Johannes.Thumshirn@wdc.com, linux-block@vger.kernel.org, Luis Chamberlain <mcgrof@kernel.org>, Pankaj Raghav <p.raghav@samsung.com> Subject: [PATCH v7 08/13] dm-zoned: ensure only power of 2 zone sizes are allowed Date: Wed, 15 Jun 2022 12:19:15 +0200 Message-Id: <20220615101920.329421-9-p.raghav@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220615101920.329421-1-p.raghav@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBKsWRmVeSWpSXmKPExsWy7djP87rum1YmGdyfpG+x+m4/m8W0Dz+Z LX6fPc9ssffdbFaLCz8amSxuHtjJZLFn0SQmi5WrjzJZPFk/i9mi58AHFou/XfeAYi0PgYpv aVtc3jWHzWL+sqfsFjcmPGW0+Ly0hd1izc2nLBZtG78yOgh7XL7i7fHvxBo2j52z7rJ7XD5b 6rFpVSebx8KGqcwem5fUe+y+2QCUa73P6vF+31U2j74tqxg91m+5yuKx+XS1x+dNch7tB7qZ AvijuGxSUnMyy1KL9O0SuDJ+3znDVvCLu6Jj3mGmBsY3nF2MnBwSAiYSE9vfsIPYQgIrGCW2 bLTrYuQCsr8wSvTs3MgKkfjMKPHsQx1Mw8PDS5ghipYzSjS8Pc4K4bxklLi0Yx1TFyMHB5uA lkRjJ9hUEYFwiaN77jGB1DAL9DFLbD3XBzZVWCBYYv/BfUwgNouAqsTfvqMsIDavgJXE8Y6D bBDb5CVmXvoONohTwFpix+weVogaQYmTM5+A1TMD1TRvnQ12kYTAOU6J3v1PmSCaXSS6Jr+G soUlXh3fwg5hy0j83zkfKl4t8fTGb6jmFkaJ/p3r2UA+kADa1ncmB8RkF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ITE7YVNjBC2sMSf a11sEEXPGSUaT+0DSnBwsAloSTR2gtWLCERLdN58D1bDLLCAWeL57VlsIAlhgUCJZccbmUBs FgFVib99R1lAbF4BK4njHQfZIBbIS8y89B1sEKeAtcSO2T2sIPOFgGp2vYuHKBeUODnzCVgr M1B589bZzBMYBWYhSc1CklrAyLSKUSS1tDg3PbfYSK84Mbe4NC9dLzk/dxMjMMq3Hfu5ZQfj ylcf9Q4xMnEwHmKU4GBWEuE1C16ZJMSbklhZlVqUH19UmpNafIjRFOjsicxSosn5wDSTVxJv aGZgamhiZmlgamlmrCTO61nQkSgkkJ5YkpqdmlqQWgTTx8TBKdXAVGqfM/9J7trGTYu3n9tg 4f+6KSlr6sv5XMxR4TEBV8I/7rsd7JjDtLRgWejBXSq/Yg8ucnnRobpMQmLKu7+l8w4sdJ5e n8f+4FAJx0PWK3Z8z3gZsgMfSAh8i/HQWWHlZP/n3IatOxkaljuevx8hevV6r6pM/7bYL4+f XWO0On3zzhMpv8Dj/J2lDRPLrV48XfZ+l131eaZHtncMtDR0BGf69/9MVEq8zXRhzi4HR9tl uvb8L/QX3PeQOxcX4TXpQFrRw5kHIhfUbVCLWre/p64y6xDPxAI92YwA9VqRVy9Vf7von9cL CGo44dS10dFQ0fvkjzXRh4KdJ2gE2554ryL78Ohj7jufGreXXkhtU2Ipzkg01GIuKk4EAHwS U/N7AwAA X-CMS-MailID: 20220615101951eucas1p238eb45e563bd9645af81bf16c56d98ec X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20220615101951eucas1p238eb45e563bd9645af81bf16c56d98ec X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220615101951eucas1p238eb45e563bd9645af81bf16c56d98ec References: <20220615101920.329421-1-p.raghav@samsung.com> <CGME20220615101951eucas1p238eb45e563bd9645af81bf16c56d98ec@eucas1p2.samsung.com> Precedence: bulk List-ID: <linux-block.vger.kernel.org> X-Mailing-List: linux-block@vger.kernel.org |
Series |
[v7,01/13] block: make blkdev_nr_zones and blk_queue_zone_no generic for npo2 zsze
|
expand
|
diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c index 0ec5d8b9b..ad4228db5 100644 --- a/drivers/md/dm-zoned-target.c +++ b/drivers/md/dm-zoned-target.c @@ -792,6 +792,10 @@ static int dmz_fixup_devices(struct dm_target *ti) return -EINVAL; } zone_nr_sectors = blk_queue_zone_sectors(q); + if (!is_power_of_2(zone_nr_sectors)) { + ti->error = "Zone size not power of 2"; + return -EINVAL; + } zoned_dev->zone_nr_sectors = zone_nr_sectors; zoned_dev->nr_zones = blkdev_nr_zones(zoned_dev->bdev->bd_disk); @@ -806,6 +810,10 @@ static int dmz_fixup_devices(struct dm_target *ti) q = bdev_get_queue(zoned_dev->bdev); zoned_dev->zone_nr_sectors = blk_queue_zone_sectors(q); zoned_dev->nr_zones = blkdev_nr_zones(zoned_dev->bdev->bd_disk); + if (!is_power_of_2(zoned_dev->zone_nr_sectors)) { + ti->error = "Zone size not power of 2"; + return -EINVAL; + } } if (reg_dev) {