Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4785656pxb; Thu, 14 Oct 2021 11:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI+X7N9vYPxE34qjt6OXs7COT9Ny5sDryla2zzyKOnNMaRW1RIFHhkpTR3RmdRDXQiig0U X-Received: by 2002:a17:90b:4b48:: with SMTP id mi8mr7828603pjb.26.1634237734037; Thu, 14 Oct 2021 11:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634237734; cv=none; d=google.com; s=arc-20160816; b=AIAXqtJuzfsplxPZ/S6i2UkiKXCeQjpBTbdOUQwUBH0QhcpDDPBAL/A85ABCB5cWe8 LFoIETN79DmVqGiGkjb9hXzVS03WiXG12yaVkk+EtKiUcDOWHcRMLGbChRVFu0TtYjvC OHZGhCqFYH7/EnFMBOA/Kwx00yiQ1Wag7JQVjjnpBxTAUIh8bC3bLfLofUhB/si1LXIy Daw41bW8BGkpx/Gq7gawwte1GLYJo2QF32agLJHsk9ssz5YMBNAmp7NHCT1iMnI2HoJC joJLO+jMPhlaNtRt1hOVHWvXhrVU0TSgbs39WYpYERbrlzyepwkIxHD0Ey91johjBbij 6KoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=QNOndtAPRGpqhXTX2FJjLHZSEuRxoMnhwtpO2+N6L0Q=; b=DHeqtjJEGWGa+ctBiVQrFzEZKzO1fZ+kfbwS+PgQra6bl553hZp2Mk3mByGX8dYpVF HRbbiYdJTfYADWnwHVNXUxt7hSjTPgWwgyG1lyV4n+ZMUVs3WTjInc94EZPHKooRMyjq mFY6bAk1Dfrror6MGh33nhwxwFcwmEKS7s2+xHZlaJ6TBTiC6n54nRmzAm0r4DcKiCUn zxEwSN2lLZAtMoBrz9xmTcpTwVsDZMhpdodQekzCtM1TEUC9FawRoVyWVVwFzre67/m7 8O53jfoDhouU/G90Clv1gMHAYkizo6pkU7Z5xxxBD/AjRpyl/XUdEQ94mg3daGauAeIp YgqA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si12350401pjq.167.2021.10.14.11.55.21; Thu, 14 Oct 2021 11:55:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233152AbhJNRGv (ORCPT + 99 others); Thu, 14 Oct 2021 13:06:51 -0400 Received: from smtp.hosts.co.uk ([85.233.160.19]:54728 "EHLO smtp.hosts.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233025AbhJNRGv (ORCPT ); Thu, 14 Oct 2021 13:06:51 -0400 X-Greylist: delayed 5331 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 Oct 2021 13:06:49 EDT Received: from host86-155-223-151.range86-155.btcentralplus.com ([86.155.223.151] helo=[192.168.1.65]) by smtp.hosts.co.uk with esmtpa (Exim) (envelope-from ) id 1mb2lr-0006Lw-DM; Thu, 14 Oct 2021 16:35:51 +0100 Subject: Re: don't use ->bd_inode to access the block device size To: Kees Cook , Dave Kleikamp Cc: "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" References: <20211013051042.1065752-1-hch@lst.de> <20211014062844.GA25448@lst.de> <3AB8052D-DD45-478B-85F2-BFBEC1C7E9DF@tuxera.com> <202110140813.44C95229@keescook> From: Wol Message-ID: Date: Thu, 14 Oct 2021 16:35:49 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <202110140813.44C95229@keescook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 14/10/2021 16:14, Kees Cook wrote: >> I don't really mind bdev_size since it's analogous to i_size, but >> bdev_nr_bytes seems good to me. > I much prefer bdev_nr_bytes(), as "size" has no units. Does it mean size IN bytes, or size OF A byte? :-) Cheers, Wol