diff options
author | Jan Kara <jack@suse.cz> | 2017-03-02 16:50:13 +0100 |
---|---|---|
committer | Ritesh Harjani <riteshh@codeaurora.org> | 2017-10-18 12:05:44 +0530 |
commit | 16d289189c40a69737bbb59ea6520ab4dec205da (patch) | |
tree | edf35c568a7700c1018447bf7617ee6009db79d6 /include/linux/writeback.h | |
parent | 9c197e78d2888e51936f5794ae9356ef42aca160 (diff) |
block: Initialize bd_bdi on inode initialization
So far we initialized bd_bdi only in bdget(). That is fine for normal
bdev inodes however for the special case of the root inode of
blockdev_superblock that function is never called and thus bd_bdi is
left uninitialized. As a result bdev_evict_inode() may oops doing
bdi_put(root->bd_bdi) on that inode as can be seen when doing:
mount -t bdev none /mnt
Fix the problem by initializing bd_bdi when first allocating the inode
and then reinitializing bd_bdi in bdev_evict_inode().
Thanks to syzkaller team for finding the problem.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Fixes: b1d2dc5659b4 ("block: Make blk_get_backing_dev_info() safe without open bdev")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
Change-Id: I9c34ca321ab311936946187ed21e25d67caf5ba5
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
Git-commit: 7ee143f46cb1f58ee07194076b9a3e6ea3f27ad3
[riteshh@codeaurora.org: resolved merge conflicts]
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
Diffstat (limited to 'include/linux/writeback.h')
0 files changed, 0 insertions, 0 deletions