From patchwork Wed Jun 15 10:19:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Raghav X-Patchwork-Id: 12882066 Return-Path: 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 BE1ECC433EF for ; Wed, 15 Jun 2022 10:20:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347680AbiFOKU5 (ORCPT ); Wed, 15 Jun 2022 06:20:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347686AbiFOKUQ (ORCPT ); Wed, 15 Jun 2022 06:20:16 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36BA74D6B2 for ; Wed, 15 Jun 2022 03:20:08 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20220615102007euoutp010ee730594c85c69b7edd786648d9cbc1~4xAk_8JIm2585525855euoutp01Y for ; Wed, 15 Jun 2022 10:20:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20220615102007euoutp010ee730594c85c69b7edd786648d9cbc1~4xAk_8JIm2585525855euoutp01Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1655288407; bh=2x4a7MWIZaoS9EpNftzI215np6IWsBpMSE6yLnny6oA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oOCZSlvokOj7/McdYG//bVJvHaHOwivKCJeDdUua+DMrm/RdggDQ29r4RDa45qtu8 wPLBeekjhR++8wfNMyhqX4mZiPzzR5OlklmTJda08SUPDcbTNtFzJk6iyqmoT3E27Z EmS+lMv60uxbaovAp9Y/NzPsIggmut5k62Yv36Fc= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220615102005eucas1p2e51799f03f95acf5c1f7703f8351de94~4xAjFUQzG2114721147eucas1p2r; Wed, 15 Jun 2022 10:20:04 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 6A.4B.09664.452B9A26; Wed, 15 Jun 2022 11:20:04 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20220615102004eucas1p1e458ea097d381058b16fc6daa3eec998~4xAipn0SG1175911759eucas1p1l; Wed, 15 Jun 2022 10:20:04 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220615102004eusmtrp2ba89836fb0aa21ef02b3525c2b0f566c~4xAiouw-J0361403614eusmtrp2F; Wed, 15 Jun 2022 10:20:04 +0000 (GMT) X-AuditID: cbfec7f2-d97ff700000025c0-37-62a9b254e53c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 63.34.09038.452B9A26; Wed, 15 Jun 2022 11:20:04 +0100 (BST) Received: from localhost (unknown [106.210.248.244]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220615102003eusmtip1d5651274b4871f0239331522fba58745~4xAhxZ7w90653206532eusmtip1U; Wed, 15 Jun 2022 10:20:03 +0000 (GMT) From: Pankaj Raghav 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, Pankaj Raghav Subject: [PATCH v7 11/13] dm-table: allow non po2 zoned devices Date: Wed, 15 Jun 2022 12:19:18 +0200 Message-Id: <20220615101920.329421-12-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 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCKsWRmVeSWpSXmKPExsWy7djP87ohm1YmGfT8trBYfbefzWLah5/M Fr/Pnme22PtuNqvFhR+NTBY3D+xkstizaBKTxcrVR5ksnqyfxWzRc+ADi8XfrntAsZaHQMW3 tC0u75rDZjF/2VN2i89LW9gt1tx8ymLRtvEro4OQx+Ur3h7/Tqxh89g56y67x+WzpR6bVnWy eSxsmMrssXlJvcfumw1Audb7rB7v911l8+jbsorRY/2Wqywem09Xe3zeJOfRfqCbKYA/issm JTUnsyy1SN8ugSuj7+VjloLJvBVbNyxgaWC8xtXFyMkhIWAisbZnIWsXIxeHkMAKRontP3uh nC+MEvfmb2aCcD4zSjzfep0VpuX/nW6oxHJGidYt/6Ccl4wS/18uZOxi5OBgE9CSaOxkB2kQ EQiXOLrnHlgNs8ALJonFt+eCTRIWsJc4fPchWBGLgKrE08nvGEFsXgFriRXTvjBDbJOXmHnp O1gNJ1B8x+weVogaQYmTM5+wgNjMQDXNW2czgyyQEDjFKTHn8yuoU10krmx7DTVIWOLV8S3s ELaMxP+d85kg7GqJpzd+QzW3MEr071zPBvKBBNC2vjM5ICazgKbE+l36EOWOErdmP2eCqOCT uPFWEOIEPolJ26YzQ4R5JTrahCCqlSR2/nwCtVRC4nLTHBaIEg+JzbOYJzAqzkLyyywkv8xC WLuAkXkVo3hqaXFuemqxYV5quV5xYm5xaV66XnJ+7iZGYMI8/e/4px2Mc1991DvEyMTBeIh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S4tz03OLjfSKE3OLS/PS9ZLzczcxAmN727GfW3Ywrnz1Ue8Q IxMH4yFGCQ5mJRFes+CVSUK8KYmVValF+fFFpTmpxYcYTYHOnsgsJZqcD0wueSXxhmYGpoYm ZpYGppZmxkrivJ4FHYlCAumJJanZqakFqUUwfUwcnFINTGE1fct12DbUWbio1Cz6x3t4ncua GUItl5xyTF5/07x3uVKMR981dD9faUhh3v6XRiutYuJ9fl9ZI9DC5PEssnxitvdfYa/bvpfe v/1VZPr291u2fRdv/bvKdMkmc/3PmnuZDkHPt++ut7FVsSg+8Vs1s3TD6gfXXq99tf9i8Prf tlK/yz7v5vC9szB3y6qOzeGBH6O8L0pdydm9jndC4J3zJeydhYEm02/5f2wKv7XA00BLLz3E Qs/ts//pWZGpYjy/WQ9+/vnkjvXdz/+S7Hs1Su4aBuqFp0x7PmUtJ8u0wLc7Nbvi+VIennvu qL3q5dWlqUs9p/I3bBD+de70vRiPWd0Tzmyqbea8wbTDoUGJpTgj0VCLuag4EQDxEq7qdgMA AA== X-CMS-MailID: 20220615102004eucas1p1e458ea097d381058b16fc6daa3eec998 X-Msg-Generator: CA X-RootMTR: 20220615102004eucas1p1e458ea097d381058b16fc6daa3eec998 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220615102004eucas1p1e458ea097d381058b16fc6daa3eec998 References: <20220615101920.329421-1-p.raghav@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org As the block layer now supports non po2 zoned devices, allow dm to support non po2 zoned device. Signed-off-by: Pankaj Raghav --- drivers/md/dm-table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index b553cdb6d..ec77e7830 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -251,7 +251,7 @@ 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 (blk_queue_is_zone_start(bdev_get_queue(bdev), start)) { + if (!blk_queue_is_zone_start(bdev_get_queue(bdev), start)) { DMWARN("%s: start=%llu not aligned to h/w zone size %u of %pg", dm_device_name(ti->table->md), (unsigned long long)start, @@ -268,7 +268,7 @@ static int device_area_is_invalid(struct dm_target *ti, struct dm_dev *dev, * devices do not end up with a smaller zone in the middle of * the sector range. */ - if (blk_queue_is_zone_start(bdev_get_queue(bdev), len)) { + if (!blk_queue_is_zone_start(bdev_get_queue(bdev), len)) { DMWARN("%s: len=%llu not aligned to h/w zone size %u of %pg", dm_device_name(ti->table->md), (unsigned long long)len, @@ -1648,7 +1648,7 @@ static int validate_hardware_zoned_model(struct dm_table *table, } /* Check zone size validity and compatibility */ - if (!zone_sectors || !is_power_of_2(zone_sectors)) + if (!zone_sectors) return -EINVAL; if (dm_table_any_dev_attr(table, device_not_matches_zone_sectors, &zone_sectors)) {