From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEC8FC43217 for ; Mon, 18 Oct 2021 17:18:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C47886127B for ; Mon, 18 Oct 2021 17:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233927AbhJRRVB (ORCPT ); Mon, 18 Oct 2021 13:21:01 -0400 Received: from verein.lst.de ([213.95.11.211]:35226 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233239AbhJRRVA (ORCPT ); Mon, 18 Oct 2021 13:21:00 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id E094C68AFE; Mon, 18 Oct 2021 19:18:43 +0200 (CEST) Date: Mon, 18 Oct 2021 19:18:43 +0200 From: Christoph Hellwig To: Jens Axboe Cc: Christoph Hellwig , Coly Li , Mike Snitzer , Song Liu , David Sterba , Josef Bacik , Theodore Ts'o , OGAWA Hirofumi , Dave Kleikamp , Ryusuke Konishi , Anton Altaparmakov , Konstantin Komarov , Kees Cook , 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-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: don't use ->bd_inode to access the block device size v3 Message-ID: <20211018171843.GA3338@lst.de> References: <20211018101130.1838532-1-hch@lst.de> <4a8c3a39-9cd3-5b2f-6d0f-a16e689755e6@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4a8c3a39-9cd3-5b2f-6d0f-a16e689755e6@kernel.dk> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Oct 18, 2021 at 11:16:08AM -0600, Jens Axboe wrote: > This looks good to me. Followup question, as it's related - I've got a > hacky patch that caches the inode size in the bdev: > > https://git.kernel.dk/cgit/linux-block/commit/?h=perf-wip&id=c754951eb7193258c35a574bd1ccccb7c4946ee4 > > so we don't have to dip into the inode itself for the fast path. While > it's obviously not something being proposed for inclusion right now, is > there a world in which we can make something like that work? There's just two places that update i_size for block devices: set_capacity and bdev_set_nr_sectors. So you just need to update bd_nr_sectors there and you're done.