Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1168645ioo; Fri, 27 May 2022 03:06:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/DEFrnJpE/bzp/Rmp/UjcBxYhrhrpxNBkHK0oA2G9YnvZAITru7+v/OqXZ1XidAFPJVgW X-Received: by 2002:a05:6a00:811:b0:518:b0eb:9132 with SMTP id m17-20020a056a00081100b00518b0eb9132mr22149599pfk.57.1653645998803; Fri, 27 May 2022 03:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653645998; cv=none; d=google.com; s=arc-20160816; b=fmtZFsl7ttysBnEhLAXhy1OUn5JjDJa94s1df5Wh4RyNeB68b0gCP/SWSXLcNX0gho zVdCDGtqHrOSPpL8WbM0scsbS2mpCpOaQau7Lo7iKNfM2a2rPiilWiaERj2fVVcPfEeq m+7iuZ+jIDNeijdo/IURXQl4WHYVabbAXx7dNbq2kYlmI5Q44XkLmjZgeDIshx9wzLAC PZ257hUTvdif08JJw1Q/r0PIz0jJGUKagLkT/+/eyYsiArz/c9wAB9LDYHKtDf0g21va icNP0AkW73Sbn1+wFc4kfMZ1AVcnJxFzwIe4J8VTW9gJBGwNnfH4Lrw3RYaUI/gXHaED 44nA== 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=sRas2qHYxGK26QnM0GFTIv2tqbVuA6ew52jA7d50Ke4=; b=mAtTzM1ERp59F5PlJ7TuF+oVJ/OtMgU10ogRwnsw/UeWK9aGAxys+0kYVeuYja+d4n zyv42L1iQFHn+e+HpbzUeZFTh8YW2XDkjDHP7AuY6LmA60ZCu49lKEyiSxbeTBSUhA2X rAkspfpIcxX/ypjG7pYpZ57YfaNT8ipS/BsDI7t+eMDS2r7sjVUVUFXOZsF4zQ9CgwZV CwQMB4Izb3+8XAhL1xqan8+UT9Ysr5beamERnEQ3UAzTHKU4caIAKkB5Xt9ySqvj0Jvi HdfL+1D+Y4JUXUarr3Ii3+o7lHffuKb6zd/FWTpuhFso1up4mlM3oFeutxfagy/b8hUx 8koA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=u4CNpUNB; 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 g3-20020a056a000b8300b00518820f0cbfsi5418243pfj.335.2022.05.27.03.06.27; Fri, 27 May 2022 03:06:38 -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=u4CNpUNB; 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 S1346595AbiEZIMT (ORCPT + 99 others); Thu, 26 May 2022 04:12:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235278AbiEZIMR (ORCPT ); Thu, 26 May 2022 04:12:17 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2CB72495D for ; Thu, 26 May 2022 01:12:13 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220526081208euoutp0257f636d6bc0cb4a3688eb09b2b19deeb~ymXH-mw6M0361603616euoutp02A for ; Thu, 26 May 2022 08:12:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220526081208euoutp0257f636d6bc0cb4a3688eb09b2b19deeb~ymXH-mw6M0361603616euoutp02A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1653552728; bh=sRas2qHYxGK26QnM0GFTIv2tqbVuA6ew52jA7d50Ke4=; h=Date:Subject:To:CC:From:In-Reply-To:References:From; b=u4CNpUNBsZNfGY8XCXMlSrtQ6OEG7NfUmZhZeUrqECHG7F1B6gaUATwtK1mKRZREp NfckJQ+AMDp36iRSs6fx+52oYdwBwGG6uBxkH0KkgNGx7TGCMidkKw/7bzGI1K4gIq rOis8hnSW/Qq26mGEQOPFxdXiYA6EjKATknN89xg= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220526081207eucas1p262ca8d7088c8d4898fe9d4be45008a35~ymXHoT8V80059300593eucas1p2P; Thu, 26 May 2022 08:12:07 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id B5.78.10260.7563F826; Thu, 26 May 2022 09:12:07 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220526081207eucas1p25fb941ce7f8344420295750bb810501d~ymXHKcZIZ1109011090eucas1p2_; Thu, 26 May 2022 08:12:07 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220526081207eusmtrp1b0614131c1302506df87eb12313c097c~ymXHJaB9E2331823318eusmtrp1c; Thu, 26 May 2022 08:12:07 +0000 (GMT) X-AuditID: cbfec7f5-bddff70000002814-09-628f3657ef99 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2E.35.09522.7563F826; Thu, 26 May 2022 09:12:07 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220526081206eusmtip24929ef2f4ad0112677d59e7337e17df4~ymXG5LKB43167731677eusmtip2k; Thu, 26 May 2022 08:12:06 +0000 (GMT) Received: from [192.168.8.130] (106.210.248.20) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 26 May 2022 09:12:04 +0100 Message-ID: <0bb57f61-9a33-0273-4b89-2cdf042e56dd@samsung.com> Date: Thu, 26 May 2022 10:12:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v6 8/8] dm: ensure only power of 2 zone sizes are allowed Content-Language: en-US To: Damien Le Moal , , , , , CC: , , , , , , , From: Pankaj Raghav In-Reply-To: <9703ca4c-33cf-cb3a-b46b-6b0e5537cfd6@opensource.wdc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [106.210.248.20] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOKsWRmVeSWpSXmKPExsWy7djPc7rhZv1JBkd2KlmsvtvPZvH77Hlm i73vZrNaXPjRyGSxZ9EkJouVq48yWTxZP4vZoufABxaLv133mCz23tK2uLxrDpvF/GVP2S3a Nn5ldOD1+HdiDZvH5bOlHptWdbJ5bF5S77H7ZgObx87W+6we7/ddZfNYv+Uqi8fm09UenzfJ ebQf6GYK4I7isklJzcksSy3St0vgyni98j1j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AA== X-CMS-MailID: 20220526081207eucas1p25fb941ce7f8344420295750bb810501d X-Msg-Generator: CA X-RootMTR: 20220525155008eucas1p2c843cc9098f2920e961f80ffaf535789 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220525155008eucas1p2c843cc9098f2920e961f80ffaf535789 References: <20220525154957.393656-1-p.raghav@samsung.com> <20220525154957.393656-9-p.raghav@samsung.com> <9703ca4c-33cf-cb3a-b46b-6b0e5537cfd6@opensource.wdc.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,NICE_REPLY_A, 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 Hi Damien, On 5/26/22 01:13, Damien Le Moal wrote: > On 5/26/22 00:49, Pankaj Raghav wrote: >> 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), > > I thought the agreed upon idea is be to add a dm-linear like target to > emulate power of 2 zone size so that we can keep btrfs and f2fs running on > this new class of device. So why this patch ? > > The entire series as is will fragment zoned block device support, which is > not a good thing at all. Without the new dm target, none of the current > kernel supported zone stuff will work. > I have mentioned this in my cover letter: The support is planned to be added in two phases: - Add npo2 support to block, nvme layer and necessary stop gap patches in the filesystems - Add dm target for npo2 devices so that they are presented as a po2 device to filesystems This series is targeting the first phase where we have stop gap patches and add support to the block and nvme layer and in the next phase we will add a dm linear like target for npo2 zone sizes which can be used by all the filesystems. This patch makes sure that we can't use npo2 zoned devices without the proper support that will be added in the next phase in the DM. Even though we decided we would like to take the direction of DM, I am still awaiting reply from Christoph who raised concerns about npo2 zoned device support and Mike Snitzer about this approach. That is one of the reason I split this effort into two phases. > The zonefs patch is also gone from the series. Why ? As is, zonefs will > break if it is passed a non power of 2 zone size drive. > I think this was my mistake. If you agree with the above approach, then I can add a stop gap patch also to zonefs npo2 zoned devices. This way all the zone filesystem support goes via DM for npo2 zoned devices. I am proposing this so that initially we always have only one way of accessing a npo2 zoned device (via DM) from **filesystems** until we add native support.