Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2835523ioo; Tue, 24 May 2022 07:04:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcv90rk4vuHX7RSDfxf+Ws6TLiZYstPc6YYMzyRSomz2e7bl3+6ir/0XDEUUsmlRmzDjbc X-Received: by 2002:a63:df0f:0:b0:3db:2d4:ded9 with SMTP id u15-20020a63df0f000000b003db02d4ded9mr24140544pgg.267.1653401087269; Tue, 24 May 2022 07:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653401087; cv=none; d=google.com; s=arc-20160816; b=YexBUTOgw3k+pb0P6AQLcBxCxjeM79pwBlhnEUZEFz5ZV0PVOBIWu0sraNp2uEt2yo R7u9uOMrHa3ShcDQUHzc02/5EFgOdQyOpVM0NDIGtPyrpu4IFbPTcpRILehle1EBxY6J JxRJHOHgrQK/wnyKd4JBnZPIb3s3gAU3RMKwDb6Rk5FT7LVS7LRXgGIhIZtYbO1W6NLI rVcbdi/Mvv584adNNlm5XpTh3oWGe7+bm2idYRKA8UCFi/jVLltBPM9xJeblq2jW6EAQ HsqWYAuBACdUH5EGNoJJrtd0tpULiyZxOELluhzdIBmNQ4W1nYrCEQoGpex5NEhQK2ow Cc6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=a0j+eGyIExxw/xCWRVi02HB4i2K9lQe+UZypWJ7Vo34=; b=o89VT31+CxYspg21kXMjnB5N4PJdnEAwVQNiOEvVz0CeZNc9iYsn+u2MkA71bN5En1 Kzvu8kCi6uXDxn6g89wWnhesoexiSFXVZzh18xWW/3SbUpx3aF5PnmVm/wdy0LamBYFg mjbJBYtcKFo43Hp7W7XmZiPaHMHG7pPSdF33uTea16XFHQdabCwG2ys75eERegtK/FqV Td+B6TcBXwwqaz6HDqf8HpKWKkRgv+guQ2ymbv3UBGbFXlXzC0II9GwojSLCTq5E9nHs ZW4Wrl/hK1w9bvgthuxfpqAaMz4HKSohq30xKBdJeW/FJZiGKWL49OpofcgrlFdXvuG/ raYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=NcY9en9m; dkim=neutral (no key) header.i=@suse.de header.b=U2qG3aZq; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n7-20020a63a507000000b003aa5155f4e8si13957258pgf.128.2022.05.24.07.04.34; Tue, 24 May 2022 07:04:47 -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.de header.s=susede2_rsa header.b=NcY9en9m; dkim=neutral (no key) header.i=@suse.de header.b=U2qG3aZq; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234808AbiEXHOU (ORCPT + 99 others); Tue, 24 May 2022 03:14:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234746AbiEXHOO (ORCPT ); Tue, 24 May 2022 03:14:14 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E6065D5DA; Tue, 24 May 2022 00:14:14 -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-out2.suse.de (Postfix) with ESMTPS id BB95F1F8B8; Tue, 24 May 2022 07:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1653376452; h=from:from:reply-to: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; bh=a0j+eGyIExxw/xCWRVi02HB4i2K9lQe+UZypWJ7Vo34=; b=NcY9en9mfR0ufFWjwKCLJCZhg2UJx0dSnuukRvQ9/GZsd1X6RwoZ4D/v3xSy05H7SG/SKs ijz/enAnj7z8V3y/g4iBc/2Yrl/6ih05ucelgpEuecPccuhWXle8TAkzTvDEjKrjbsIRu8 Y+qzyAFx1JY1y94ObP8u0HeMiHkg1ks= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1653376452; h=from:from:reply-to: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; bh=a0j+eGyIExxw/xCWRVi02HB4i2K9lQe+UZypWJ7Vo34=; b=U2qG3aZqBm+6MXLn1ccnhetjs3ksEvlga9okE/jR3YPr4H7ATlUUkR6iPgmWHAjZaF+oTH x38VoXDTKmUE4sCg== 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 6A61113ADF; Tue, 24 May 2022 07:14:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eUf7GMSFjGL1QQAAMHmgww (envelope-from ); Tue, 24 May 2022 07:14:12 +0000 Message-ID: <83ef402e-1cff-a675-eab6-9fac9bb7565d@suse.de> Date: Tue, 24 May 2022 09:14:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v5 2/7] block: allow blk-zoned devices to have non-power-of-2 zone size Content-Language: en-US To: Pankaj Raghav , axboe@kernel.dk, hch@lst.de, snitzer@redhat.com, damien.lemoal@opensource.wdc.com, Johannes.Thumshirn@wdc.com Cc: linux-nvme@lists.infradead.org, dm-devel@redhat.com, dsterba@suse.com, jiangbo.365@bytedance.com, linux-kernel@vger.kernel.org, gost.dev@samsung.com, linux-block@vger.kernel.org, jaegeuk@kernel.org, Luis Chamberlain References: <20220523161601.58078-1-p.raghav@samsung.com> <20220523161601.58078-3-p.raghav@samsung.com> <214e0c82-ce20-ba0f-77bd-21f3b83fd1f1@samsung.com> From: Hannes Reinecke In-Reply-To: <214e0c82-ce20-ba0f-77bd-21f3b83fd1f1@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 On 5/24/22 09:10, Pankaj Raghav wrote: > On 5/24/22 07:19, Hannes Reinecke wrote: > >>> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h >>> index c4e4c7071b7b..f5c7a41032ba 100644 >>> --- a/include/linux/blkdev.h >>> +++ b/include/linux/blkdev.h >>> @@ -676,6 +676,21 @@ static inline unsigned int >>> blk_queue_zone_no(struct request_queue *q, >>>       return div64_u64(sector, zone_sectors); >>>   } >>>   +static inline bool blk_queue_is_zone_start(struct request_queue *q, >>> sector_t sec) >>> +{ >>> +    sector_t zone_sectors = blk_queue_zone_sectors(q); >>> +    u64 remainder = 0; >>> + >>> +    if (!blk_queue_is_zoned(q)) >>> +        return false; >>> + >> >> Not sure if we need this here; surely blk_queue_zone_sectors() will >> already barf, and none of the callers did this check. >> > I totally agree with you but all the other blk_queue_* functions had > this defensive check and I didn't want to break that pattern: > Ah, fair enough. Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman