Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp313370ioo; Thu, 26 May 2022 04:24:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydxOmO4RZ6qctrWPdqh2T70dCs01bWnsSdB9QVhbc4CqqxbNP0M3hxgUe/OzXgkyil+uvJ X-Received: by 2002:a17:902:db07:b0:163:5374:6732 with SMTP id m7-20020a170902db0700b0016353746732mr649427plx.15.1653564280680; Thu, 26 May 2022 04:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653564280; cv=none; d=google.com; s=arc-20160816; b=XP9VHtx2T9h3n26YrfCglWiXausSlrGx87mSl/FQd2IW/Gt3RlFqVWpWSCk2MPDDHi rAGn5xTLbyyw3vhHPn18nlqN98QNaY5J8LSSUuJPnS4wMzogxyuRyis1LuPLY+ZhTZjn kJ2W1GqffoxPEFrdR39XUg1DuIX5RmF6koZGrVX2ML98q4f7xFRjLw6Tx89JViQeIo66 nMA0OS3gDMIsOW8gDgh+6MGd+mOgNjZ9L77woki3ev30QbvKm7VCE1NqrJE3AzWgQ4FJ 5/3MRPRv4CUkEatLpUro8sW6WcElhi8Nogx/GXjj/QRWArwPkOZgUoxnLQtKeIkj6huq 615Q== 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 :mime-version:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=sJcs4ay0hQ3CcXQiFMNDhZ8v6ROIy7WSZthy8VqD664=; b=DX5mVeUlyBh1XJt3naR1hFP2ZLXEZ0YhBlBpIA1TflsOqD+KADOcosUVUz6yiGe+O4 k2wzjaxVmWLMFaXuNPtwvSZKbarILZWfuziGCsPxoXrI5KF7MMck1TtmHiwlPfpKloQs /fF+VAbpR8+gL+1DcqZvsJvlFwYoPY5Co7WZLHBIdcjSDsGKvIAOkN7mca7VmpmETM+l Now25wUTmDgW66M0oN7yjtkAyBBJe4IupnzgEYk3Grhg+oMxnXaROSQ8/HRYUwZdhQ3n IjaRjGik+S39k+QC3+TxK4/lXJG3Y0Q8kkY7FfnAVxSCQYiUrDQjG032bE9cniHKqkAq cKvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=YNX5bjAY; 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 15-20020a63020f000000b003f61dd69a6dsi2100309pgc.863.2022.05.26.04.24.29; Thu, 26 May 2022 04:24:40 -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=YNX5bjAY; 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 S245397AbiEYPuz (ORCPT + 99 others); Wed, 25 May 2022 11:50:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245396AbiEYPuN (ORCPT ); Wed, 25 May 2022 11:50:13 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58C8334B86 for ; Wed, 25 May 2022 08:50:12 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220525155011euoutp0255e0dad2a298e0685c1c8d16ff28cbab~yY9xQc-Ag0258602586euoutp02Y for ; Wed, 25 May 2022 15:50:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220525155011euoutp0255e0dad2a298e0685c1c8d16ff28cbab~yY9xQc-Ag0258602586euoutp02Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1653493811; bh=sJcs4ay0hQ3CcXQiFMNDhZ8v6ROIy7WSZthy8VqD664=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YNX5bjAYu1tkdf73vb1Q6Y2iZVDfyvK1dzG3KioR/JgvD6R6huel8XduDAfAjWAck 45SpJaqIQL2540ce0/C+Q879AkQa94bFYOGEgYzzUppq8V6+jlDQFWywS1Y0XqM17R JJy45bq/3KxdcdycoqNOYKv2sVhv0kkMXta7X1MI= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220525155009eucas1p2d4bd13415b909eaaf6c6ca7e53c3fdb0~yY9vmoDnt0522505225eucas1p2N; Wed, 25 May 2022 15:50:09 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F0.00.10260.1305E826; Wed, 25 May 2022 16:50:09 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220525155008eucas1p2c843cc9098f2920e961f80ffaf535789~yY9vPWFha2575925759eucas1p23; Wed, 25 May 2022 15:50:08 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220525155008eusmtrp1a64719bbb66a103e535236dc149d926e~yY9vMaFka1510315103eusmtrp1M; Wed, 25 May 2022 15:50:08 +0000 (GMT) X-AuditID: cbfec7f5-bddff70000002814-e6-628e503101f0 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id F0.27.09522.0305E826; Wed, 25 May 2022 16:50:08 +0100 (BST) Received: from localhost (unknown [106.210.248.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220525155008eusmtip1a64c0e3e336ababa11af2ab44dfa7e53~yY9u2GdvG1782817828eusmtip1c; Wed, 25 May 2022 15:50:08 +0000 (GMT) From: Pankaj Raghav To: axboe@kernel.dk, damien.lemoal@opensource.wdc.com, snitzer@redhat.com, Johannes.Thumshirn@wdc.com, hch@lst.de, hare@suse.de Cc: dsterba@suse.com, dm-devel@redhat.com, jiangbo.365@bytedance.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, jaegeuk@kernel.org, gost.dev@samsung.com, Pankaj Raghav Subject: [PATCH v6 8/8] dm: ensure only power of 2 zone sizes are allowed Date: Wed, 25 May 2022 17:49:57 +0200 Message-Id: <20220525154957.393656-9-p.raghav@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220525154957.393656-1-p.raghav@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOKsWRmVeSWpSXmKPExsWy7djPc7qGAX1JBsdu8FmsvtvPZvH77Hlm i73vZrNaXPjRyGRx88BOJos9iyYxWaxcfZTJ4sn6WcwWPQc+sFj87brHZLH3lrbF5V1z2Czm L3vKbvF5aQu7RdvGr4wO/B7/Tqxh87h8ttRj06pONo/NS+o9dt9sYPPY2Xqf1eP9vqtsHn1b VjF6rN9ylcVj8+lqj8+b5DzaD3QzBfBEcdmkpOZklqUW6dslcGXMW/eGreAbe0XXa7MGxnVs XYycHBICJhJ/T9xh72Lk4hASWMEosf7NXEYI5wujxImtHWwQzmdGiS0HX8G1PH97kRkisZxR ou/iFhaQhJDAC0aJKYtquhg5ONgEtCQaO8HGigg0MkpMfXkCbCyzwFd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3QzBfBE6dkU5ZeWpCpk5BeX2CpFG1oY6RlaWugZmVjqGRqb x1oZmSrp29mkpOZklqUW6dsl6GXMW/eGreAbe0XXa7MGxnVsXYycHBICJhLP315k7mLk4hAS WMoocar/AjNEQkLi9sImRghbWOLPtS6wBiGBZ4wSH3ZrdzFycLAJaEk0drKD9IoIdDJKzNnX CuYwC/xnlPjTcRGsWVjAU6K7cRpYM4uAqsTky+9ZQGxeASuJlgXvoZbJS8y89J0dxOYUsJaY v/8zM8QyK4mvd76yQtQLSpyc+QSslxmovnnrbOYJjAKzkKRmIUktYGRaxSiSWlqcm55bbKhX nJhbXJqXrpecn7uJERih24793LyDcd6rj3qHGJk4GA8xSnAwK4nwXnjamyTEm5JYWZValB9f VJqTWnyI0RTo7onMUqLJ+cAUkVcSb2hmYGpoYmZpYGppZqwkzutZ0JEoJJCeWJKanZpakFoE 08fEwSnVwLT8TdKR9fHVn7LiXvbuO/F603rt914ZSf9WP+KKPLZwilHkxQfNRlP0w5Zu/8Ne F6WX6a3lrOYjpjZB5fZZdUmD7Aa1f1cncGZ+vGv2x97q1aufmzzYr7YkfDu2tW1Ww4lEv3Yf fZ3Drp9uCX7X9IndVbN95aWK0j1LXI593+0Y01nmtWfTBbXDHM/s/t1QTWq18g4/MtNfaPIp jrQnukVzJvs+m1Whttwr0/6VjHReo0tK5I2Y/3J2jVXuDxx3Pv603vSSe/HMvninLXmGm+LX TFvna3TNaea2M2t790UFXcq4vLLo6Mq+ktdWXW9368wt8DXbsOef5skakSDLwBm7p6yS/RJQ 2P1ue9Wn43uVWIozEg21mIuKEwHyFF8FWQMAAA== X-CMS-MailID: 20220525155008eucas1p2c843cc9098f2920e961f80ffaf535789 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20220525155008eucas1p2c843cc9098f2920e961f80ffaf535789 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220525155008eucas1p2c843cc9098f2920e961f80ffaf535789 References: <20220525154957.393656-1-p.raghav@samsung.com> X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Ensure that only power of 2 zoned devices are enabled for dm targets that supports zoned devices. This constraint can be relaxed once non power of 2 zone size support is added to the DM layer. Signed-off-by: Pankaj Raghav --- drivers/md/dm-table.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 03541cfc2317..2a8af70d1d4a 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -251,6 +251,12 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev, if (bdev_is_zoned(bdev)) { unsigned int zone_sectors = bdev_zone_sectors(bdev); + if (!is_power_of_2(zone_sectors)) { + DMWARN("%s: %pg only power of two zone size supported", + dm_device_name(ti->table->md), bdev); + return 1; + } + if (start & (zone_sectors - 1)) { DMWARN("%s: start=%llu not aligned to h/w zone size %u of %pg", dm_device_name(ti->table->md), -- 2.25.1