Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp124461pxu; Wed, 6 Jan 2021 23:52:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2Glh9oo5A3U3cpduIUO2byVMUDoyZhFbZXK3x5kbx5Cm5lSVlYIQpcLXjq2Jwf52W0Z9J X-Received: by 2002:a17:906:3094:: with SMTP id 20mr5322769ejv.218.1610005919836; Wed, 06 Jan 2021 23:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610005919; cv=none; d=google.com; s=arc-20160816; b=a31UkR6HVU+aN/jYsJE7KwIeF4IGGUNeex7dot2YKBWVOPGTfn9UHmPhalnRgogcry xr+5WNGLUHxCVykgJX9WAKYfYHHScQafxk9SRjpSjFILcDXnKGuR+Lbs46WG1PtcME6f tS+4+EmbZG5kC0WYi/SMEWBplgcWw4dNCHKezm4kOWpquikRqOLDYMI0kfL2fNTiUBfa 4JHZObxFBdEPNJ8SQEVQDLNfIBkFF1nV/tLD9JCuGgHpZ8b5ZQUmKo2ZB92MIITbcNKB OQW7fuFw3wDxL55+rPzgaFvnbwFjMkstm+N+ovds0CeVmtQDiyc8nRW5L863T2AatjZ8 HALg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=TY4BaLpcAnVqDv2s+kZ8o1ARlcrb1ozxSGED4dVORek=; b=bs00Yn+1RVXUIp9V4gjFWdxIltRb+HpfQASFDsGLrmmN/Nh14Nlvv8OeVLgHdbOO/F VPX4bwnSlj6Np76BUPAGZFFxx+/am+xsiz0w/JSXqg3EqiZKJgcogkRJ7nsmQoDHvTZV 1IgZpaV+DAj4GtIN9+PiS69Ul2NybpcB4HBGSVLTy5TrrccvEYSrisOUvjUpqjT22Nvn c+5wxdpblt0uPSVullbO9QohgeWCnXHfkOgPdKEhd3dckGPMfeH6WUG+53alg/ka+AQu SKH5XatnmcYv+7lCY4zSkX0T6Ag2/Nr8jU1M4fKdR4WahYXjpnBWIK2IAeKnGSB90VJL tkEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 w17si1951918edv.64.2021.01.06.23.51.36; Wed, 06 Jan 2021 23:51:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726436AbhAGHs5 (ORCPT + 99 others); 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-kernel@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?