From mboxrd@z Thu Jan 1 00:00:00 1970 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 C3345C04A68 for ; Thu, 28 Jul 2022 12:21:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238213AbiG1MVH (ORCPT ); Thu, 28 Jul 2022 08:21:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238371AbiG1MU4 (ORCPT ); Thu, 28 Jul 2022 08:20:56 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 386436BC39; Thu, 28 Jul 2022 05:20:48 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 34E8F372EC; Thu, 28 Jul 2022 12:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1659010847; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RCAW+pbfUR2hVcHVMffOWUnXziugm9XBYRvhJy477A0=; b=cMRYfjiF85Ju7aoXKWebUfzKaaxAh4M92EX4IXjucc3NE4stUbOAL3sAN10XyEuDhvTtgO mudPs9ipMIYBpXlV+jQdTqtruaGzgaxYxp1RcNuMgNgA73mumpqM1MNAHd1tMYeuLRWsAQ OS2DF90UakFMEaNlkwCwJSHIoWq8iLc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1659010847; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RCAW+pbfUR2hVcHVMffOWUnXziugm9XBYRvhJy477A0=; b=X4PURyY8PyuTCefkGj2BlbcoYaTtFZE8nrFKK4Di4OURQ/j61s4hh92pzXeOY3sXOVopOF yqWvufOot5YtS3Bg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CA18113A7E; Thu, 28 Jul 2022 12:20:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4b3zLx5/4mKbJgAAMHmgww (envelope-from ); Thu, 28 Jul 2022 12:20:46 +0000 Date: Thu, 28 Jul 2022 14:15:48 +0200 From: David Sterba To: Pankaj Raghav Cc: damien.lemoal@opensource.wdc.com, hch@lst.de, axboe@kernel.dk, snitzer@kernel.org, Johannes.Thumshirn@wdc.com, matias.bjorling@wdc.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org, hare@suse.de, linux-block@vger.kernel.org, pankydev8@gmail.com, bvanassche@acm.org, jaegeuk@kernel.org, dm-devel@redhat.com, linux-nvme@lists.infradead.org, Luis Chamberlain Subject: Re: [PATCH v8 07/11] dm-zoned: ensure only power of 2 zone sizes are allowed Message-ID: <20220728121548.GE13489@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Pankaj Raghav , damien.lemoal@opensource.wdc.com, hch@lst.de, axboe@kernel.dk, snitzer@kernel.org, Johannes.Thumshirn@wdc.com, matias.bjorling@wdc.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org, hare@suse.de, linux-block@vger.kernel.org, pankydev8@gmail.com, bvanassche@acm.org, jaegeuk@kernel.org, dm-devel@redhat.com, linux-nvme@lists.infradead.org, Luis Chamberlain References: <20220727162245.209794-1-p.raghav@samsung.com> <20220727162245.209794-8-p.raghav@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220727162245.209794-8-p.raghav@samsung.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Wed, Jul 27, 2022 at 06:22:41PM +0200, Pankaj Raghav wrote: > --- a/drivers/md/dm-zoned-target.c > +++ b/drivers/md/dm-zoned-target.c > @@ -792,6 +792,10 @@ static int dmz_fixup_devices(struct dm_target *ti) > return -EINVAL; > } > zone_nr_sectors = bdev_zone_sectors(bdev); > + if (!is_power_of_2(zone_nr_sectors)) { > + ti->error = "Zone size is not power of 2"; This could print what's the value of zone_nr_sectors > + return -EINVAL; > + } > zoned_dev->zone_nr_sectors = zone_nr_sectors; > zoned_dev->nr_zones = bdev_nr_zones(bdev); > } > @@ -804,6 +808,10 @@ static int dmz_fixup_devices(struct dm_target *ti) > return -EINVAL; > } > zoned_dev->zone_nr_sectors = bdev_zone_sectors(bdev); > + if (!is_power_of_2(zoned_dev->zone_nr_sectors)) { > + ti->error = "Zone size is not power of 2"; Same > + return -EINVAL; > + } > zoned_dev->nr_zones = bdev_nr_zones(bdev); > } > > -- > 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E7CEC04A68 for ; Thu, 28 Jul 2022 12:27:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659011274; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3Y4lNitQGVDnAVI78P8c2JQM8YPg2eyvb0qe2eLsQbo=; b=LnjAqjD+CrdoLGl+OjOywuV5m4sU98fj+CZJhSgAblQgDviuUF5pHDqXQ1/IrUgltmZfKZ RrsMHB0has/IB6OBmNhjeXxW4jpdMHbKHpdACdVCGCBxqMIXmNWreg2Q1RrjUkIpvYgytw Wpc+1Qtt0RaclVCGkiXlxbYnw8v10rU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-22-B7Chn144N1G59FlZiwZC6w-1; Thu, 28 Jul 2022 08:27:51 -0400 X-MC-Unique: B7Chn144N1G59FlZiwZC6w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 751CC8032F1; Thu, 28 Jul 2022 12:27:49 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EFAEC28100; Thu, 28 Jul 2022 12:27:49 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 301F21945DA7; Thu, 28 Jul 2022 12:27:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 049741945D85 for ; Thu, 28 Jul 2022 12:27:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D77132166B2B; Thu, 28 Jul 2022 12:27:47 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D38542166B26 for ; Thu, 28 Jul 2022 12:27:47 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B74A81C01B38 for ; Thu, 28 Jul 2022 12:27:47 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-83-KxJieHCdOiKb9SPl5hl09g-1; Thu, 28 Jul 2022 08:27:46 -0400 X-MC-Unique: KxJieHCdOiKb9SPl5hl09g-1 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 34E8F372EC; Thu, 28 Jul 2022 12:20:47 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CA18113A7E; Thu, 28 Jul 2022 12:20:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4b3zLx5/4mKbJgAAMHmgww (envelope-from ); Thu, 28 Jul 2022 12:20:46 +0000 Date: Thu, 28 Jul 2022 14:15:48 +0200 From: David Sterba To: Pankaj Raghav Message-ID: <20220728121548.GE13489@twin.jikos.cz> Mail-Followup-To: dsterba@suse.cz, Pankaj Raghav , damien.lemoal@opensource.wdc.com, hch@lst.de, axboe@kernel.dk, snitzer@kernel.org, Johannes.Thumshirn@wdc.com, matias.bjorling@wdc.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org, hare@suse.de, linux-block@vger.kernel.org, pankydev8@gmail.com, bvanassche@acm.org, jaegeuk@kernel.org, dm-devel@redhat.com, linux-nvme@lists.infradead.org, Luis Chamberlain References: <20220727162245.209794-1-p.raghav@samsung.com> <20220727162245.209794-8-p.raghav@samsung.com> MIME-Version: 1.0 In-Reply-To: <20220727162245.209794-8-p.raghav@samsung.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Subject: Re: [dm-devel] [PATCH v8 07/11] dm-zoned: ensure only power of 2 zone sizes are allowed X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: dsterba@suse.cz Cc: axboe@kernel.dk, bvanassche@acm.org, pankydev8@gmail.com, Johannes.Thumshirn@wdc.com, damien.lemoal@opensource.wdc.com, snitzer@kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, dm-devel@redhat.com, gost.dev@samsung.com, jaegeuk@kernel.org, hch@lst.de, matias.bjorling@wdc.com, Luis Chamberlain Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, Jul 27, 2022 at 06:22:41PM +0200, Pankaj Raghav wrote: > --- a/drivers/md/dm-zoned-target.c > +++ b/drivers/md/dm-zoned-target.c > @@ -792,6 +792,10 @@ static int dmz_fixup_devices(struct dm_target *ti) > return -EINVAL; > } > zone_nr_sectors = bdev_zone_sectors(bdev); > + if (!is_power_of_2(zone_nr_sectors)) { > + ti->error = "Zone size is not power of 2"; This could print what's the value of zone_nr_sectors > + return -EINVAL; > + } > zoned_dev->zone_nr_sectors = zone_nr_sectors; > zoned_dev->nr_zones = bdev_nr_zones(bdev); > } > @@ -804,6 +808,10 @@ static int dmz_fixup_devices(struct dm_target *ti) > return -EINVAL; > } > zoned_dev->zone_nr_sectors = bdev_zone_sectors(bdev); > + if (!is_power_of_2(zoned_dev->zone_nr_sectors)) { > + ti->error = "Zone size is not power of 2"; Same > + return -EINVAL; > + } > zoned_dev->nr_zones = bdev_nr_zones(bdev); > } > > -- > 2.25.1 -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel