Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4920850iob; Mon, 9 May 2022 04:55:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu4lpO/SRecvFsoLH2kGAyTJypqgdOUfbIuuqJYhqeZ4Cw/WQ4V6MB2Qidff3vBxThLwYO X-Received: by 2002:a05:6a00:21c7:b0:4fd:f89f:ec17 with SMTP id t7-20020a056a0021c700b004fdf89fec17mr15830538pfj.72.1652097357072; Mon, 09 May 2022 04:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652097357; cv=none; d=google.com; s=arc-20160816; b=Vnn7rcySsoruJmyjhVbgklUc+JSnJTzsoU9JGgN9H/C6HcnpB07FL7zx8LqHHxWjwG 1tMVufOFOH31mslh7gBk8/gp96KaIDZsESIWoYTMc11Vu7yN90dHxQOoY7XOYklPWLM4 FTk5NZ4VOiuE4Xpvx+ptJig8FWwZHoqkPyldBEFDDTzfqOOak8EOlAGOZ6h4S6OnqkpD zPTLovICahVpwKNAYIGwUokg+I3YSVOy69poXfpaEhgn7k1A5UR7A1R0uuv6C9Y7rbl/ JmyYPMvXEQVoI6/X472QxWW2xzlmTGGSofJdOcj/W+2IKbvscoylEOzHPrI446YrMD3h NIyg== 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:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=Mnu1uZ0XlQCSGQep4KRRRtHeMBWQSPIJe7BthMoBXHU=; b=rl5Y/Z9qaWzUQq4lJG3Q4U0o3Wk7TW7u8AQ4Pn2/705rS8jkCNlJWzxJRvF8A4BLfq +tM8o6HD2xS6a7QYR5O/UQStCk9JXQnZtaP6WHC4JP2f7CZhUyGE2yzlvxgzrgfMWk7p Ce7DhWMX8eymzRa4izoeqi6akgf1uExBfUGtHbgvZ2kCLG4RSND12bYIk+DtA1RwXtfS jlwzCdY1PFTOhBfeRiqxJowQT3Wqkv5Trd0/6lFOYGhD4u7mxdkgkWg7hE6FBRRHN2QE wCRJ5Bkfa5bvRomXh3EcEfpe9Op5NsIGSmL2QzGmfSfhr9Owp4VsQHEX7VkFR4l5E5DB bWYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="I4CogB/D"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u12-20020a170902e80c00b0015cecd8602asi12703180plg.41.2022.05.09.04.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 04:55:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="I4CogB/D"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CC225264F; Mon, 9 May 2022 04:08:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231985AbiEILKh (ORCPT + 99 others); Mon, 9 May 2022 07:10:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232214AbiEILKa (ORCPT ); Mon, 9 May 2022 07:10:30 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC75F15E619 for ; Mon, 9 May 2022 04:06:27 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20220509110626euoutp01a476cd22700bd56945cf2e4c6869101f~taxdW8gG50071700717euoutp01T for ; Mon, 9 May 2022 11:06:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20220509110626euoutp01a476cd22700bd56945cf2e4c6869101f~taxdW8gG50071700717euoutp01T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1652094386; bh=Mnu1uZ0XlQCSGQep4KRRRtHeMBWQSPIJe7BthMoBXHU=; h=Date:Subject:To:CC:From:In-Reply-To:References:From; b=I4CogB/DrCIFjWaa7JhjTlUq+8wZMkNK9B4Odld5CVhTLKtL8MuMTLH2Gov0Vray0 6/AeYQ2+wYHeQZ5l9jnhz3OtSzag2cYKK9tT1QEGDPGbP1DWo1oba8ROWKqJdIwd4I X26iqidL+H7AT/nCE3phyNuXnvLnkG0KhZEBhXoY= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20220509110625eucas1p1f964acbddfe7891b98f63e6ff7fc0b07~taxcm_e4G1538615386eucas1p14; Mon, 9 May 2022 11:06:25 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 5B.E0.10260.1B5F8726; Mon, 9 May 2022 12:06:25 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220509110625eucas1p243f900c817606c7e5c9b2118694bd775~taxcKNU2F0280002800eucas1p2u; Mon, 9 May 2022 11:06:25 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220509110624eusmtrp2ddefeac67b6ec0e261a9a0128a1eb6bb~taxcI4G4X1743917439eusmtrp2B; Mon, 9 May 2022 11:06:24 +0000 (GMT) X-AuditID: cbfec7f5-bf3ff70000002814-95-6278f5b1cb1e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 46.B3.09522.0B5F8726; Mon, 9 May 2022 12:06:24 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220509110624eusmtip15754ef24a5e25ae9d009ed4324ccbd42~taxb8LugR1905219052eusmtip1Z; Mon, 9 May 2022 11:06:24 +0000 (GMT) Received: from [106.110.32.130] (106.110.32.130) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 9 May 2022 12:06:23 +0100 Message-ID: Date: Mon, 9 May 2022 13:06:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v3 10/11] null_blk: allow non power of 2 zoned devices Content-Language: en-US To: Damien Le Moal , , , , , , CC: Chris Mason , Josef Bacik , , , , Jens Axboe , , , , , , Naohiro Aota , , Johannes Thumshirn , Sagi Grimberg , Alasdair Kergon , , Chaitanya Kulkarni , Keith Busch , , Luis Chamberlain From: Pankaj Raghav In-Reply-To: <39a80347-af70-8af0-024a-52f92e27a14a@opensource.wdc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [106.110.32.130] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) X-Brightmail-Tracker: H4sIAAAAAAAAA02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UCgtYHbn2Xo/1GqieWRTYAIMNbACyMV4w5+cfclO5nHTpN0dolTJF pZXTahsQrX6SHgsLSVOuzmyWJkUojhQJo8WSSJFEvIsXyknMPiHlkjKphv6KprNp1f/3GOyA MB2jNSf+4KEvlvaMGVpKWe/rHUW2TlPS9sOS5BqXvXlTeOLGgbyqXI/pzef7Y/N/kdXzF1bq 7Eytg3/DXl2c6lraP9N4r8J0KtawGPrgoqV2st84uxfzvHritQ+R4WT72Z7WHE6BqTpBP7+b L9l3/Uhec9Uo+YjsU8V8MPlxoHd8wfF14XH3w/aitNkqaYdXvpPzZdFOo2ROzX3jQJBTI2sT iZP4zZE55tq03R309BV5cvt7ETbFk3qtqlExZGm6+WifNvb2prDHL3Mqjl8bSK87N84s3zB1 90C0kQRnX8QnMjeCYWdtuGJb29YtKTW2DS0Jez6y45f0j/NkmcDxiYbNw9UZUuEOTKWW/gf+ NzBQ+wMAAA== X-CMS-MailID: 20220509110625eucas1p243f900c817606c7e5c9b2118694bd775 X-Msg-Generator: CA X-RootMTR: 20220506081116eucas1p2cce67bbf30f4c9c4e6854965be41b098 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220506081116eucas1p2cce67bbf30f4c9c4e6854965be41b098 References: <20220506081105.29134-1-p.raghav@samsung.com> <20220506081105.29134-11-p.raghav@samsung.com> <39a80347-af70-8af0-024a-52f92e27a14a@opensource.wdc.com> X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 >> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c >> index 5cb4c92cd..ed9a58201 100644 >> --- a/drivers/block/null_blk/main.c >> +++ b/drivers/block/null_blk/main.c >> @@ -1929,9 +1929,8 @@ static int null_validate_conf(struct nullb_device *dev) >> if (dev->queue_mode == NULL_Q_BIO) >> dev->mbps = 0; >> >> - if (dev->zoned && >> - (!dev->zone_size || !is_power_of_2(dev->zone_size))) { >> - pr_err("zone_size must be power-of-two\n"); >> + if (dev->zoned && !dev->zone_size) { >> + pr_err("zone_size must not be zero\n"); > > May be a simpler phrasing would be better: > > pr_err("Invalid zero zone size\n"); > Ack. I will change this in the next rev. >> return -EINVAL; >> } >> >> diff --git a/drivers/block/null_blk/zoned.c b/drivers/block/null_blk/zoned.c >> index dae54dd1a..00c34e65e 100644 >> --- a/drivers/block/null_blk/zoned.c >> +++ b/drivers/block/null_blk/zoned.c >> @@ -13,7 +13,10 @@ static inline sector_t mb_to_sects(unsigned long mb) >> >> static inline unsigned int null_zone_no(struct nullb_device *dev, sector_t sect) >> { >> - return sect >> ilog2(dev->zone_size_sects); >> + if (is_power_of_2(dev->zone_size_sects)) >> + return sect >> ilog2(dev->zone_size_sects); > > As a separate patch, I think we should really have ilog2(dev->zone_size_sects) > as a dev field to avoid doing this ilog2 for every call.. > I don't think that is possible because `zone_size_sects` can also be non po2.