diff options
author | Jan Kara <jack@suse.cz> | 2017-02-21 18:09:48 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-02-21 12:51:54 -0700 |
commit | cccd9fb9ec960e343b2f354c4613e49f5a1d8371 (patch) | |
tree | 6c1a5faefa1c176303720d94a0983eafbb618672 /net/netlabel | |
parent | d06e05c026ab58121dc6ab37c11f855ff642531e (diff) | |
download | linux-cccd9fb9ec960e343b2f354c4613e49f5a1d8371.tar.gz linux-cccd9fb9ec960e343b2f354c4613e49f5a1d8371.tar.bz2 linux-cccd9fb9ec960e343b2f354c4613e49f5a1d8371.zip |
block: Revalidate i_bdev reference in bd_aquire()
When a device gets removed, block device inode unhashed so that it is not
used anymore (bdget() will not find it anymore). Later when a new device
gets created with the same device number, we create new block device
inode. However there may be file system device inodes whose i_bdev still
points to the original block device inode and thus we get two active
block device inodes for the same device. They will share the same
gendisk so the only visible differences will be that page caches will
not be coherent and BDIs will be different (the old block device inode
still points to unregistered BDI).
Fix the problem by checking in bd_acquire() whether i_bdev still points
to active block device inode and re-lookup the block device if not. That
way any open of a block device happening after the old device has been
removed will get correct block device inode.
Tested-by: Lekshmi Pillai <lekshmicpillai@in.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 'net/netlabel')
0 files changed, 0 insertions, 0 deletions