Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp112877imn; Fri, 29 Jul 2022 01:11:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vRdZtyjFncdRvQKXmdB7cgF5JB7Nuku0WezqcTGexd4Ql+E9Jpqnf/NF6tvcrnwL9Uk7Lk X-Received: by 2002:a05:6402:190b:b0:43a:c95d:ec93 with SMTP id e11-20020a056402190b00b0043ac95dec93mr2365416edz.44.1659082304552; Fri, 29 Jul 2022 01:11:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659082304; cv=none; d=google.com; s=arc-20160816; b=StJuUScy8Abbiusi6suQEPkvGOZjLS5MWScCyE+b0al0ktpJHM5lwtIY+nOofEeRCK saIaLkc3xNcZ4i3aLGSvWaeaMl4qrMbepZAOVKzMvwQg1Iv2ClLbMpKkKBmUU5bf/J7F 4o6EUdfau7OAsjZ4MySFiQFmF13sy7fvbFKjAFSz/rhJcCoH2xG6XvgoqEC3jfD5tMmR F+GSvnMBzHek/bcBkL31CucRUlePrwy4Ap9Qn+x5kMBZ8IhXFZqyZEoRZZtKNaW+mMd+ uerDHX1MiOuAr/OsBl3kO521Ltk43i76y9c/4DA1V+1qpryI41XQmAMZbrrUio+E1F6Z /SGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :in-reply-to:from:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=E6lXkBi5RBzNBG22b6pYLRtecimhvNbXZsiuxzLw5pw=; b=rQfo4NUqIhOnIGK30rrW+KI4SdSo15WVOVcmKNnda1gow9yATpRziccJM2zDcVyeSh Nw5DhmOuw9d/Orc8xtvhSFfm3mSQqkCUyT5lDwQIg0nIvx3yo3OvbAZTcV6VeWJJzWMa n6ZJg1geULSxhtD6uA0agBXlR1yK23uBM1K7gHPytG/7jitWnnrl/5eferYLErbqP/ZW uXvCuyKpFDmjDZ60P23hDnk3ZBm9i3sL7ZuWdwe9lJ3TI487/oVeOw+euwsrugyYQtsq Qsg97QqpT+vUTC0wnWYUOVG865D0wBVjyit1vwyEGvEGaXoiyjI/PIb+JdLQG33GGKfD YrbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=gdJ6KwEh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id au16-20020a170907093000b00711da52c6e4si2267422ejc.309.2022.07.29.01.11.19; Fri, 29 Jul 2022 01:11:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=gdJ6KwEh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235072AbiG2IBG (ORCPT + 99 others); Fri, 29 Jul 2022 04:01:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235036AbiG2IBD (ORCPT ); Fri, 29 Jul 2022 04:01:03 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C39082F65F for ; Fri, 29 Jul 2022 01:01:00 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220729080058euoutp021253d53a6dce3a1f82b9d80f0aedcce1~GPfptluPq2119521195euoutp020 for ; Fri, 29 Jul 2022 08:00:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220729080058euoutp021253d53a6dce3a1f82b9d80f0aedcce1~GPfptluPq2119521195euoutp020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1659081658; bh=E6lXkBi5RBzNBG22b6pYLRtecimhvNbXZsiuxzLw5pw=; h=Date:Subject:To:From:In-Reply-To:References:From; b=gdJ6KwEhv6DuwNkrdPCqMEWHOf+aMrF8tMchjUNG4c3Yx5hcBP3ZGD0GEbVG7hiOh 9FpzDFJg6Ylbd2g+cW5Si+pzUevBRJLRToCPvKBkOkpLPoCz1ceL6pGm33f3VLak/v +lPeOSpYI4qElmb8VJwD9aHLaKU0bPqs0cvbCzvs= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220729080057eucas1p2bf1e6dbfb1801a86419b17785cb129d3~GPfpOczkL1743317433eucas1p27; Fri, 29 Jul 2022 08:00:57 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 7C.D6.10067.9B393E26; Fri, 29 Jul 2022 09:00:57 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220729080057eucas1p2d3ab499ae1905a2a1df51a4a81a01723~GPfo06HdV1787517875eucas1p2y; Fri, 29 Jul 2022 08:00:57 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220729080057eusmtrp2c7bf9e55abbeacd657be9b783f9d7b88~GPfoz63Zy1448014480eusmtrp24; Fri, 29 Jul 2022 08:00:57 +0000 (GMT) X-AuditID: cbfec7f4-dc1ff70000002753-a0-62e393b96c7d Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id CF.03.09038.9B393E26; Fri, 29 Jul 2022 09:00:57 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220729080057eusmtip1b1ab989d52f0805ddccea4b804ada970~GPfoqr6xS2228922289eusmtip1g; Fri, 29 Jul 2022 08:00:57 +0000 (GMT) Received: from [192.168.8.130] (106.210.248.8) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 29 Jul 2022 09:00:54 +0100 Message-ID: <3f817b2f-ee25-c643-8d7a-aa0b543b4ca6@samsung.com> Date: Fri, 29 Jul 2022 10:00:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v8 07/11] dm-zoned: ensure only power of 2 zone sizes are allowed Content-Language: en-US To: , , , , , , , , , , , , , , , , Luis Chamberlain From: Pankaj Raghav In-Reply-To: <20220728121548.GE13489@twin.jikos.cz> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [106.210.248.8] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBKsWRmVeSWpSXmKPExsWy7djP87o7Jz9OMmj/am6x+m4/m8W0Dz+Z LX6fPc9ssffdbFaLxb+/s1jsWTSJyWLl6qNMFk/Wz2K2+Nt1j8li7y1ti8u75rBZzF/2lN1i QttXZosbE54yWqy5+ZTF4sQtaQcBj8tXvD12zrrL7nH5bKnHplWdbB6bl9R77L7ZwOaxs/U+ q8f7fV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k6pWLN62qDFxaXViwkRxFiWW 4oxEQy3mouJEAGk4zn+mAwAA X-CMS-MailID: 20220729080057eucas1p2d3ab499ae1905a2a1df51a4a81a01723 X-Msg-Generator: CA X-RootMTR: 20220727162253eucas1p1a5912e0494f6918504cc8ff15ad5d31f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220727162253eucas1p1a5912e0494f6918504cc8ff15ad5d31f References: <20220727162245.209794-1-p.raghav@samsung.com> <20220727162245.209794-8-p.raghav@samsung.com> <20220728121548.GE13489@twin.jikos.cz> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-07-28 14:15, David Sterba wrote: > On Wed, Jul 27, 2022 at 06:22:41PM +0200, Pankaj Raghav wrote: >> --- 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 = bdev_zone_sectors(bdev); >> + if (!is_power_of_2(zone_nr_sectors)) { >> + ti->error = "Zone size is not power of 2"; > > This could print what's the value of zone_nr_sectors Ok. I will rephrase based on Damien's comment and add the zone_nr_sectors to be included. Thanks. > >> + return -EINVAL; >> + } >> zoned_dev->zone_nr_sectors = zone_nr_sectors; >> zoned_dev->nr_zones = bdev_nr_zones(bdev); >> } >> @@ -804,6 +808,10 @@ static int dmz_fixup_devices(struct dm_target *ti) >> return -EINVAL; >> } >> zoned_dev->zone_nr_sectors = bdev_zone_sectors(bdev); >> + if (!is_power_of_2(zoned_dev->zone_nr_sectors)) { >> + ti->error = "Zone size is not power of 2"; > > Same > >> + return -EINVAL; >> + } >> zoned_dev->nr_zones = bdev_nr_zones(bdev); >> } >> >> -- >> 2.25.1