[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210107074812.GA1089@lst.de>
Date: Thu, 7 Jan 2021 08:48:12 +0100
From: Christoph Hellwig <hch@....de>
To: Alexey Kardashevskiy <aik@...abs.ru>
Cc: Jan Kara <jack@...e.cz>, Christoph Hellwig <hch@....de>,
Alexander Viro <viro@...iv.linux.org.uk>,
Hannes Reinecke <hare@...e.de>, Jens Axboe <axboe@...nel.dk>,
Tejun Heo <tj@...nel.org>, linux-block@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH kernel] block: initialize block_device::bd_bdi for
bdev_cache
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?
Powered by blists - more mailing lists