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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5638C433E6 for ; Thu, 7 Jan 2021 07:49:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC0262312A for ; Thu, 7 Jan 2021 07:49:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725959AbhAGHs5 (ORCPT ); Thu, 7 Jan 2021 02:48:57 -0500 Received: from verein.lst.de ([213.95.11.211]:39566 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbhAGHs5 (ORCPT ); Thu, 7 Jan 2021 02:48:57 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id C757C68AFE; Thu, 7 Jan 2021 08:48:12 +0100 (CET) Date: Thu, 7 Jan 2021 08:48:12 +0100 From: Christoph Hellwig To: Alexey Kardashevskiy Cc: Jan Kara , Christoph Hellwig , Alexander Viro , Hannes Reinecke , Jens Axboe , Tejun Heo , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH kernel] block: initialize block_device::bd_bdi for bdev_cache Message-ID: <20210107074812.GA1089@lst.de> References: <20210106092900.26595-1-aik@ozlabs.ru> <20210106104106.GA29271@quack2.suse.cz> <5e6716a6-0314-8360-4fb6-5c959022a24c@ozlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5e6716a6-0314-8360-4fb6-5c959022a24c@ozlabs.ru> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Thu, Jan 07, 2021 at 10:58:39AM +1100, Alexey Kardashevskiy wrote: >> And AFAICT the root inode on >> bdev superblock can get only to bdev_evict_inode() and bdev_free_inode(). >> Looking at bdev_evict_inode() the only thing that's used there from struct >> block_device is really bd_bdi. bdev_free_inode() will also access >> bdev->bd_stats and bdev->bd_meta_info. So we need to at least initialize >> these to NULL as well. > > These are all NULL. > >> IMO the most logical place for all these >> initializations is in bdev_alloc_inode()... > > > This works. We can also check for NULL where it crashes. But I do not know > the code to make an informed decision... The root inode is the special case, so I think moving the the initializers for everything touched in ->evict_inode and ->free_inode to bdev_alloc_inode makes most sense. Alexey, do you want to respin or should I send a patch?