Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp446246imn; Thu, 28 Jul 2022 05:47:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vpbQJPyq9vBBzcTqEKT0V+WUA5O3sCrPcPp/X+vrvmdgNosIxGxbcvqgHNyAulTbSy3FoT X-Received: by 2002:a05:6402:5413:b0:43c:67c0:d2db with SMTP id ev19-20020a056402541300b0043c67c0d2dbmr11760633edb.267.1659012423973; Thu, 28 Jul 2022 05:47:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659012423; cv=none; d=google.com; s=arc-20160816; b=093gZjq/pzSX8aOHfk6RUNyzHMUcYBTR19P3usGWuLlD+Fv9K+04GE0IDVch8x4hqY cdQnSXDOSe4gIdu1CJ2CmsGWZ/PDXoFn1S5VR9arbux6d9WqzRc3GYoqN3lEODw1eaZI Pp9mKeSumraufGolj21yKYc/9NirPGlYtnAg0UN6iJO0yG5tpbk2MHZ8r/B3d51eJAAZ UNtYV1xoxge0CMCt/o6JGlPVQWBTnjOOOIf55SMJPI8GU0wgKkHVNyMZxp60RPcWVxGk 9RzP4G/oDlYBxSAAGwP9sPK+0uzaKBJ6q6ABOgNJY1xnd23RK7bKMntnjO1niV7hkVdJ 8a4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=RCAW+pbfUR2hVcHVMffOWUnXziugm9XBYRvhJy477A0=; b=pGXwTjlVTl4kmhXl057Sg8auchIqw+hcgQvwXUO/OAkL8jc6A19csCZ40g5e2X91qC d0RU9KVtf92EVhg2QVlOm4g6veeh/8+MosMJCKjEZ/74mj1qrWssFgXAkzj0zKyRYtma O2umtdQLU2EBOlQxpcf4WYCBB09H6D82c3Cb78SbMFyL/rRh6etbx2OGGyiI2Y6jJPG6 tFHoCry4q7Pg/0HonDaBYwd4RLmQCVhhaly44Cq5PyarA+MdLrWVygTKCZk+KKforpjN erj5/BSluI45WdC+ABROGx+kLBoLszN+OVJU5/H03HUFCF3hMYw2XRSrhQ6Rd6TwiCFF Z7ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=cMRYfjiF; dkim=neutral (no key) header.i=@suse.cz header.b=X4PURyY8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a056402190600b0043b5531e9acsi761997edz.469.2022.07.28.05.46.15; Thu, 28 Jul 2022 05:47:03 -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=@suse.cz header.s=susede2_rsa header.b=cMRYfjiF; dkim=neutral (no key) header.i=@suse.cz header.b=X4PURyY8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238250AbiG1MVI (ORCPT + 99 others); Thu, 28 Jul 2022 08:21:08 -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) X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no 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 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