diff options
author | Jan Kara | 2017-03-23 01:37:00 +0100 |
---|---|---|
committer | Jens Axboe | 2017-03-23 03:11:33 +0100 |
commit | f759741d9d913eb57784a94b9bca78b376fc26a9 (patch) | |
tree | 19832434e2c4c1db34bceee048f422b910300686 /crypto/seqiv.c | |
parent | bdi: Rename cgwb_bdi_destroy() to cgwb_bdi_unregister() (diff) | |
download | kernel-qcow2-linux-f759741d9d913eb57784a94b9bca78b376fc26a9.tar.gz kernel-qcow2-linux-f759741d9d913eb57784a94b9bca78b376fc26a9.tar.xz kernel-qcow2-linux-f759741d9d913eb57784a94b9bca78b376fc26a9.zip |
block: Fix oops in locked_inode_to_wb_and_lock_list()
When block device is closed, we call inode_detach_wb() in __blkdev_put()
which sets inode->i_wb to NULL. That is contrary to expectations that
inode->i_wb stays valid once set during the whole inode's lifetime and
leads to oops in wb_get() in locked_inode_to_wb_and_lock_list() because
inode_to_wb() returned NULL.
The reason why we called inode_detach_wb() is not valid anymore though.
BDI is guaranteed to stay along until we call bdi_put() from
bdev_evict_inode() so we can postpone calling inode_detach_wb() to that
moment.
Also add a warning to catch if someone uses inode_detach_wb() in a
dangerous way.
Reported-by: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'crypto/seqiv.c')
0 files changed, 0 insertions, 0 deletions