From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 271252C81 for ; Wed, 13 Oct 2021 06:12:54 +0000 (UTC) Received: by mail-pf1-f173.google.com with SMTP id y7so1511708pfg.8 for ; Tue, 12 Oct 2021 23:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=1H1JJFKjz05y5oj0p755Wd9Nps08CHOHEplJ5Y1g+2w=; b=FnlM9CdvccmU4HmqmwsZQ6mwcBwOhpuSMmvAcPJz12hGrzMLx0wE72HESKXT/FSdf4 7+542Lua7V4TbazDGNap5DO9Pfw7c/uG+qyBy3qJkapOn+6ER85tMNMzt8DzCatnHQL8 8qEBnbzhJGY53T8EWVA6JlX/GqGluU0pFlO7o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1H1JJFKjz05y5oj0p755Wd9Nps08CHOHEplJ5Y1g+2w=; b=OjWSvb6oxb2y2Y0/GxhTiclCdbvEl1QSNlKp+LLY2zwKQjRKeAL5F17KIe4+Ud8Cuf DL3eLI/SSBTxGue1a/ioHtqVOQUDcvYDytxI2+BzhsxwmRRyUg6fAUhsgFGm7bcaHde1 IS5ZqB3wgIfxxeTUHvO/3TTX1ic7Skef420rlcCgmjN1AdreFF0GGy6IZ3sLtn9JCOzR V9gttFg+BlJxQSZFKI1dEp78RCnRZo9h9q+4PWK3q8JT1jGKe1ke9ikbMDNXhz/3UZdX khXCQL40Cj12N1E3sjHkyDGww4gKBdmuKEU/N4SHCFVhCqiXnhzjgalaPJJ8WCdAnZ4e qAjA== X-Gm-Message-State: AOAM53326E6c3u1ur9j9++bjREByaR4fgrXnCqJdD3EWyzbiAxeuCv5g hCemVZBo0qVMewTacmeWHi3k9Q== X-Google-Smtp-Source: ABdhPJyo2VCUKF6kjMdrI9PCDmpBjFpUCoF94Pv9htxPPsmjtX3akcms7YpvLn8ozHxuI/GsrlutsQ== X-Received: by 2002:aa7:91c2:0:b0:44c:a5a4:43d4 with SMTP id z2-20020aa791c2000000b0044ca5a443d4mr35433093pfa.20.1634105573663; Tue, 12 Oct 2021 23:12:53 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id z124sm12774767pfb.108.2021.10.12.23.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 23:12:53 -0700 (PDT) Date: Tue, 12 Oct 2021 23:12:52 -0700 From: Kees Cook To: Christoph Hellwig Cc: Jens Axboe , Coly Li , Mike Snitzer , Song Liu , David Sterba , Josef Bacik , Theodore Ts'o , OGAWA Hirofumi , Dave Kleikamp , Ryusuke Konishi , Anton Altaparmakov , Konstantin Komarov , Phillip Lougher , Jan Kara , linux-block@vger.kernel.org, dm-devel@redhat.com, drbd-dev@lists.linbit.com, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev, reiserfs-devel@vger.kernel.org Subject: Re: [PATCH 04/29] md: use bdev_nr_sectors instead of open coding it Message-ID: <202110122311.B43459E21@keescook> References: <20211013051042.1065752-1-hch@lst.de> <20211013051042.1065752-5-hch@lst.de> Precedence: bulk X-Mailing-List: ntfs3@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211013051042.1065752-5-hch@lst.de> On Wed, Oct 13, 2021 at 07:10:17AM +0200, Christoph Hellwig wrote: > Use the proper helper to read the block device size. > > Signed-off-by: Christoph Hellwig I think it might make sense, as you suggest earlier, to add a "bytes" helper. This is the first user in the series needing: bdev_nr_sectors(...bdev) << SECTOR_SHIFT Reviewed-by: Kees Cook -- Kees Cook