Re: [RFC PATCH kernel] block: initialize block_device::bd_bdi for bdev_cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 07/01/2021 18:48, Christoph Hellwig wrote:
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?

I really prefer you doing this as you will most likely end up fixing the commit log anyway :) Thanks,


--
Alexey



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux