]> Git Repo - linux.git/commit
block: pre-initialize struct block_device in bdev_alloc_inode
authorChristoph Hellwig <[email protected]>
Thu, 7 Jan 2021 18:36:40 +0000 (19:36 +0100)
committerJens Axboe <[email protected]>
Fri, 8 Jan 2021 03:57:53 +0000 (20:57 -0700)
commit2d2f6f1b4799428d160c021dd652bc3e3593945e
tree4e264ec25128e8367791fd66373add37ab2cde7e
parent04b1ecb6a4844cf347a1c0d7eb9b63b5eddbfeff
block: pre-initialize struct block_device in bdev_alloc_inode

bdev_evict_inode and bdev_free_inode are also called for the root inode
of bdevfs, for which bdev_alloc is never called.  Move the zeroing o
f struct block_device and the initialization of the bd_bdi field into
bdev_alloc_inode to make sure they are initialized for the root inode
as well.

Fixes: e6cb53827ed6 ("block: initialize struct block_device in bdev_alloc")
Reported-by: Alexey Kardashevskiy <[email protected]>
Tested-by: Alexey Kardashevskiy <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
fs/block_dev.c
This page took 0.053388 seconds and 4 git commands to generate.