Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp534217iob; Wed, 4 May 2022 02:23:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHeQfqMQ+CMv+RZG8/vxHdUDdNCdXSSe/JyQAPqF5yCVJq/pUWKZy5BId/h80CFdmzySne X-Received: by 2002:a05:6402:2547:b0:428:1dd3:2751 with SMTP id l7-20020a056402254700b004281dd32751mr470506edb.87.1651656189437; Wed, 04 May 2022 02:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651656189; cv=none; d=google.com; s=arc-20160816; b=KeMkEsl1VFYNqDV6F+PNc/eMUCxghGV3QWiEAOTLJIXRPKAP2NsBYB/KMF0cfrPKOA Knd8ToTlKfnJf6kv+B+y0al4Ym+5aiIXAgAHpkOiVYFB7yciMqicr80R5xyRutymSyax e39WzN7oyGIe/VlAtQcodywjk1eAJ7OplL5v9d1qzNCQ/RM9Uneh77Tm5iuuoruchLex yF9C2Zp/R3rgZx5JV33mxd8+hspbxSjUWm1fqRfMrmFuZYAXOvikQuvYTA23bFLnuel2 41M54uvbYq1tUbjZZb6JUgeEstGvuJPu20Rpcf/I2tyLr1Ps1WLoUWyx4sNqiD0wgnMq 7+IA== 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=v2Q1geij+EWsHkQOd0OOlbY8cvBwMNkdetroYG7uZJg=; b=MmnyrCPzWiMbsscQtg3kNs+LXbYvTZQ7LowfwKTzkYhPr2CVClK1bl69lUTosmNUqz M4wEE3FlaTH+1jcfxFNsbpbUW6aUW/fm0ek267kd+gO3YzAQwxsBF/ipNKo44wHo6eBh KDuWl1H7z6ovluaGHi10exOEMrOkPWOsMm7873rtz+bkSMWXYv6wcN9DYgzxPEeLLRta 2XwZmolJLiHiKG7uNyFzkKZp/edkWb7E4VOpkAMty2ELBRBsjqH7fAadWFfbA5l0c+RV mfYH3jf9pnAZXI0LrqIy7SGCRLHO7KzRT19HlYOtmUzjlwwmD82VMhY4ValEF0ZBNAIF HbBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=YW9QSpF+; 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 qf39-20020a1709077f2700b006f496889e5dsi3059920ejc.516.2022.05.04.02.22.43; Wed, 04 May 2022 02:23:09 -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=YW9QSpF+; 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 S1346438AbiEDIme (ORCPT + 99 others); Wed, 4 May 2022 04:42:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346442AbiEDImc (ORCPT ); Wed, 4 May 2022 04:42:32 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 894891EECA for ; Wed, 4 May 2022 01:38:56 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220504083855euoutp02efa181ace52fb2c1985ab705016c330f~r2iO84Vz60546405464euoutp02K for ; Wed, 4 May 2022 08:38:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220504083855euoutp02efa181ace52fb2c1985ab705016c330f~r2iO84Vz60546405464euoutp02K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1651653535; bh=v2Q1geij+EWsHkQOd0OOlbY8cvBwMNkdetroYG7uZJg=; h=Date:Subject:To:CC:From:In-Reply-To:References:From; b=YW9QSpF+LY5814YFBYaAFZ0J6CeHjAUOz5P2wSJlydoyiZmFle2mWnPRkwea7tmoa PuAJchCGGyRk2HZHY64SAzqA9BC+ub53NXme9jdknXzpOGmLXsUQv6jViqj7AtGIed dMxJxMk3qBPQZQa8OPTlG4deVAylgeUlmYevK9HE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20220504083854eucas1p10fc4f0885aa39652e7f66eedb7c8b3b7~r2iOaQegh0678506785eucas1p1F; Wed, 4 May 2022 08:38:54 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 66.C2.10260.E9B32726; Wed, 4 May 2022 09:38:54 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220504083854eucas1p27a878ea3b3c156361b1985e011e789d7~r2iOAxaSx2524025240eucas1p2_; Wed, 4 May 2022 08:38:54 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220504083854eusmtrp24bc4a1c830349bf68a4ceea515e48c11~r2iN-TlXb3001530015eusmtrp2j; Wed, 4 May 2022 08:38:54 +0000 (GMT) X-AuditID: cbfec7f5-bf3ff70000002814-d4-62723b9e95b5 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 62.3E.09522.E9B32726; Wed, 4 May 2022 09:38:54 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220504083854eusmtip13d9e6e9508fba46e708446cb1e14ed62~r2iN0ADCm1508715087eusmtip1I; Wed, 4 May 2022 08:38:54 +0000 (GMT) Received: from [192.168.8.130] (106.210.248.170) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 4 May 2022 09:38:51 +0100 Message-ID: <622d87eb-f189-a2f0-281e-a0d4c1a04293@samsung.com> Date: Wed, 4 May 2022 10:38:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 05/16] nvme: zns: Allow ZNS drives that have non-power_of_2 zone size Content-Language: en-US To: Bart Van Assche , , , , , , , , , , CC: , , , , , , , , , , , , , , , , From: Pankaj Raghav In-Reply-To: <1e3afa38-0652-0a6a-045c-79a0b9c19f30@acm.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [106.210.248.170] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) X-Brightmail-Tracker: H4sIAAAAAAAAA01Sf1CTZRzved937152zXtBkuekK26VpxIUYvZcphHQ+Z5xUZwJmUVD3kOU jbUx0lADAe9cCAOZxCiHScoAmTIEhqC2jiG/mjCgtUJDoHTChANOfpjGftjx3+f7/Xw/3+/n 89xD4T715GoqWZzGSsXCFAHJIxpM8+ag05ulCa/bjwYhXacJR9VDBSQ6NTmPoy5VD4aKCr7j osUeM45aHWUcdHMuC0Pa6jYMjerUOMq7PkmgfxW3lno5w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q7+pi80sVX91mb/qotVQ/Tv6Js+fborV/5DWl7T07QTG/7l/Po nPfb+C93lprc9+N6v6xrrd3BXcs8ty/YmxkbcC79qUeSJaO56HJBlUOHwqTjJxicffp50YSX B9imvfR80ResNlv37kx3lgP+xZt/saxaOa163itL+7sa4tsqzXrM+xlCS1U3Vjz3ffNEu+7O ucWNR9j6Y8vc/m794Srtt/WBisvqvb+ZVERmGLV6/FR60zLXarYSS3FGoqEWc1FxIgBxSFeX /QMAAA== X-CMS-MailID: 20220504083854eucas1p27a878ea3b3c156361b1985e011e789d7 X-Msg-Generator: CA X-RootMTR: 20220427160301eucas1p147d0dced70946e20dd2dd046b94b8224 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220427160301eucas1p147d0dced70946e20dd2dd046b94b8224 References: <20220427160255.300418-1-p.raghav@samsung.com> <20220427160255.300418-6-p.raghav@samsung.com> <1e3afa38-0652-0a6a-045c-79a0b9c19f30@acm.org> X-Spam-Status: No, score=-10.2 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=unavailable 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 2022-05-03 18:50, Bart Van Assche wrote: > On 4/27/22 09:02, Pankaj Raghav wrote: >> -    sector &= ~(ns->zsze - 1); >> +    sector = rounddown(sector, ns->zsze); > > The above change breaks 32-bit builds since ns->zsze is 64 bits wide and > since rounddown() uses the C division operator instead of div64_u64(). > Good catch. I don't see any generic helper for rounddown that will work for both 32 bits and 64 bits. Maybe I will open code the rounddown logic here so that it works for both 32 and 64 bits. > Thanks, > > Bart.