Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3842910pxb; Wed, 13 Oct 2021 14:15:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0S54nAinNFpAkHLs8/0KODPOeizsD6D/gW1n5tI+W11/1N/mBZzAYoz1foDptdUXv6zuZ X-Received: by 2002:a17:906:2e85:: with SMTP id o5mr1807381eji.543.1634159725032; Wed, 13 Oct 2021 14:15:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634159725; cv=none; d=google.com; s=arc-20160816; b=MoHZ30QemUkDnOVrSLEnIv7pQG1v2FBhgmv0ZMGXakPlIRHv49kM7mQ2wSTUGV6K7P +faAlCbSiaKvTKx9YZAvz+bwRQCNs09/MHZUExVDl3+yg+xVvCcvgpBLFGMrb8ZvAne3 +51DRF8i8TBR9NotH1PBgD7lhb6bOEOpGzkJsKeOPLcdIpe7rDWaje1zZVY5jvkoYNma U4BuUV+h0A20beOsQ1Lx//XAlR0kfzl0Qq5bChSUAEeSkWVuwTDOzPpJIGUMRViHZ3q4 Lh5Xuxx+jLlHAubXy/yREBX3cYk6M/6QajcmFb7cyjD13YUapGDaMmVxcgB1cWGnPO3J V6Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GNMuazvAc4LKzA11EtG8eLgr12NNdEoTIw6YmGY7ihs=; b=1InKCvBQpFmAJqCLzg8SawR0HAVX1sPycBoXcxX1w5zvsqZwThMJZbHgliC0kYjeoV 2ICpf1Ypx4mwVOzhW3bGJWrN0nntDd/BpMfIp6Ao/t2ZqhSJrmnPSEsfXIP7hWS5GZqQ vg+bm91uAljaLGPh54HaSR9a/Ya2ZJmDOeSm0VNhPVJBZgiClbRkVNJwt/X0Pf+6bfR9 vtNV/A7c0r+PBbhymabZPDC5LgR232LHWi9kt0gxa/Aw7Krn8uHpa4Qw6xTSSO/pEKsn HvpGm+PB/g1BnnALHvmpvbG/+WsqaMsuLVm304qaC0WkStr01Ym1V0YjdK3OMp6+HnAm Cywg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hiKscGct; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k23si979359edj.602.2021.10.13.14.14.52; Wed, 13 Oct 2021 14:15:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hiKscGct; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbhJMVQu (ORCPT + 99 others); Wed, 13 Oct 2021 17:16:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:44862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbhJMVQt (ORCPT ); Wed, 13 Oct 2021 17:16:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BCD7761139; Wed, 13 Oct 2021 21:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634159685; bh=SlbEmP0SftpYg5Qzgl+3uhbNwtKN42MS1eJbqRVvz8o=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=hiKscGct16rhTAVFUvB8ulUGFNYX0XJpF+2YqPKF0No0/OTxa8B+FbCYvPeznM3IT o7+9DVjPYoKAxa50QdWsJ1gL4J+4wBU1jNZrm6P/FvNKQ8G7E2qrXO9VM2GBzVJvw8 S/gFZjYpmMou1VruRE19i94wuylZi24lJbQ6yAN6OeRqXntYIE5B0JYh+T/uz9ctke L86OtKTf7XCkJxLOyXfeIFv5kZLrR3s6zlWx8Mcxq8cYKDBsASwSQxb8GUZPcnzqgT VFHmPHbz4NrsEHQ/qmk1iEmYL+m9W0ImnKdxKKKAOXKE+hMXaoTAVCJomjq0s1kTjo 7pgsY+NMeWiSg== Received: by mail-lf1-f54.google.com with SMTP id u18so17428163lfd.12; Wed, 13 Oct 2021 14:14:45 -0700 (PDT) X-Gm-Message-State: AOAM532FXiGs1sCaGxNpzsJmeQlJzE+mAIiSokLdcbxAMrOP9h09k+b9 RNkm7JcYnOu/qJ5EjWa83slixpHkeaKf2YthUvI= X-Received: by 2002:a2e:6e0b:: with SMTP id j11mr1736234ljc.527.1634159683768; Wed, 13 Oct 2021 14:14:43 -0700 (PDT) MIME-Version: 1.0 References: <20211013051042.1065752-1-hch@lst.de> <20211013051042.1065752-5-hch@lst.de> <202110122311.B43459E21@keescook> In-Reply-To: <202110122311.B43459E21@keescook> From: Song Liu Date: Wed, 13 Oct 2021 14:14:32 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 04/29] md: use bdev_nr_sectors instead of open coding it To: Kees Cook Cc: Christoph Hellwig , Jens Axboe , Coly Li , Mike Snitzer , 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 , linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, Linux-Fsdevel , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Oct 12, 2021 at 11:12 PM Kees Cook wrote: > > 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 Acked-by: Song Liu