Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2350441iob; Sat, 30 Apr 2022 06:20:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3zbneevv+xB15xIaQLrwJtJuWpb7njHP77lnn2f/LOmJ6tKmh1rtN7EWiniVeAoMY0ARy X-Received: by 2002:a17:90b:4b12:b0:1d2:8bda:ef7 with SMTP id lx18-20020a17090b4b1200b001d28bda0ef7mr9149982pjb.174.1651324842021; Sat, 30 Apr 2022 06:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651324842; cv=none; d=google.com; s=arc-20160816; b=PZvdZ3wXfnaRYDMnyWpj8SzBgBG+xXw9mvmvGRJqW7fvMJgBuDmIoRocm3L5VbVX2F 610My59Y14GmeeOMVqnwBv4g8eXb5C//KhzUEA7jfoL4yJhDYiKaSK9gLULefje2qMJ7 hG6CeLk8TWzDziVPkqAE6xtEaOFZV8IKWMpfAfYRwXueTt8/Lt2HUM4wpOTRs/0hePtP Hxh7zCfZ6xy6iv8/hOpChfuHb64RbL3dT7QEPJkXdsh5lRUx04/RJahBQM2d6hf4ZhJZ 2/G8v7NPb7w8Wv4wTj+3jjbEXiHbCXhfBZyXmO/36fwj2TSgCRUDui8O2yj2Be36L+Bz 14uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=CU5vNoZ2DyJnMSSsv6FKJaOR1+kQZIFv71gVo+f6jqA=; b=ymY4BHA6nDTP+8+taG2GXkpKFBk/G1oTx6RtjEUBF5rnM7C8KqwprPOMEnTmD45d4M CJCk/FoIW4QmdDizoZCEyJRGbm7wlhhB6BPVuXhqZ6iu7vKn2ESd/MNk6X1gS40SyQRZ 7lg6ZLxxe0aGkVn4N/jSOGVnnR54MUlQSLNeT0gHBlFXnuWAfaNzXUUTzWv92IBUrfXD vCbSqVSDP8P7G7jM1OXHb6nW/xTE7AS7GSWZfbBe28V5Wi7r+aU8YlEmTcRLSUfniUj5 rPEPKnJ9jj3YuztMW5X2dGxQ7mriDHm7puiZoKuu/oUYpO5PS5oP0uN14hG1j5s640qT HOwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=jYC4utzF; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t186-20020a6381c3000000b003aa8cac0ed5si8890403pgd.692.2022.04.30.06.20.23; Sat, 30 Apr 2022 06:20:42 -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=@infradead.org header.s=bombadil.20210309 header.b=jYC4utzF; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350565AbiD1Rhj (ORCPT + 99 others); Thu, 28 Apr 2022 13:37:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232566AbiD1Rhi (ORCPT ); Thu, 28 Apr 2022 13:37:38 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E69746833E; Thu, 28 Apr 2022 10:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CU5vNoZ2DyJnMSSsv6FKJaOR1+kQZIFv71gVo+f6jqA=; b=jYC4utzF59Rb/tKOmYemaP/wEU wlAwR2UrulKrgeXbx+/XQ0gpzYVB7MUifsOGD3Z+QGWNETWT18yE5kxNH6g2tCGUTKNaxu1V30mKc HHjpH4ZhdAywtV6L7pe/Qu39s3KZVt54yTBL6LMkSFs6tLRz0hCHoUOsJXrpicBzyVRiQjcPIeLEC AxX8KkaoM3BJvxEU3MgDQpBsZuHWf2imtywFQtsSoT5sbDHlYNiv/lCJP+6BbHnma14GU45TN1sqe PMDDVUElH/4aFK31a21gZCcTDUSyuvKpWrTHUE7MO9NPsBNFg7Fn3rbVi7b1zjNlhgIS/VVnNw8fq TAus3vPA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nk81u-0083c3-7l; Thu, 28 Apr 2022 17:34:14 +0000 Date: Thu, 28 Apr 2022 10:34:14 -0700 From: Luis Chamberlain To: Damien Le Moal Cc: Pankaj Raghav , jaegeuk@kernel.org, axboe@kernel.dk, snitzer@kernel.org, hch@lst.de, naohiro.aota@wdc.com, sagi@grimberg.me, dsterba@suse.com, johannes.thumshirn@wdc.com, linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, clm@fb.com, gost.dev@samsung.com, chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, josef@toxicpanda.com, jonathan.derrick@linux.dev, agk@redhat.com, kbusch@kernel.org, kch@nvidia.com, linux-nvme@lists.infradead.org, dm-devel@redhat.com, bvanassche@acm.org, jiangbo.365@bytedance.com, linux-fsdevel@vger.kernel.org, matias.bjorling@wdc.com, linux-block@vger.kernel.org Subject: Re: [PATCH 16/16] dm-zoned: ensure only power of 2 zone sizes are allowed Message-ID: References: <20220427160255.300418-1-p.raghav@samsung.com> <20220427160255.300418-17-p.raghav@samsung.com> <2ffc46c7-945f-ba26-90db-737fccd74fdf@opensource.wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2ffc46c7-945f-ba26-90db-737fccd74fdf@opensource.wdc.com> Sender: Luis Chamberlain X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 Thu, Apr 28, 2022 at 08:42:41AM +0900, Damien Le Moal wrote: > On 4/28/22 01:02, Pankaj Raghav wrote: > > From: Luis Chamberlain > > > > Today dm-zoned relies on the assumption that you have a zone size > > with a power of 2. Even though the block layer today enforces this > > requirement, these devices do exist and so provide a stop-gap measure > > to ensure these devices cannot be used by mistake > > > > Signed-off-by: Luis Chamberlain > > Signed-off-by: Pankaj Raghav > > --- > > drivers/md/dm-zone.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/drivers/md/dm-zone.c b/drivers/md/dm-zone.c > > index 57daa86c19cf..221e0aa0f1a7 100644 > > --- a/drivers/md/dm-zone.c > > +++ b/drivers/md/dm-zone.c > > @@ -231,6 +231,18 @@ static int dm_revalidate_zones(struct mapped_device *md, struct dm_table *t) > > struct request_queue *q = md->queue; > > unsigned int noio_flag; > > int ret; > > + struct block_device *bdev = md->disk->part0; > > + sector_t zone_sectors; > > + char bname[BDEVNAME_SIZE]; > > + > > + zone_sectors = bdev_zone_sectors(bdev); > > + > > + if (!is_power_of_2(zone_sectors)) { > > + DMWARN("%s: %s only power of two zone size supported\n", > > + dm_device_name(md), > > + bdevname(bdev, bname)); > > + return 1; > > + } > > Why ? > > See my previous email about still allowing ZC < ZS for non power of 2 zone > size drives. dm-zoned can easily support non power of 2 zone size as long > as ZC == ZS for all zones. Great, thanks for the heads up. > The problem with dm-zoned is ZC < ZS *AND* potentially variable ZC per > zone. That cannot be supported easily (still not impossible, but > definitely a lot more complex). I see thanks. Testing would still be required to ensure this all works well with npo2. So I'd prefer to do that as a separate effort, even if it is easy. So for now I think it makes sense to avoid this as this is not yet well tested. As with filesystem support, we've even have gotten hints that support for npo2 should be easy, but without proper testing it would not be prudent to enable support for users yet. One step at a time. Luis