Commit 6540fbf6 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: don't clear bd_invalidated in check_disk_size_change

bd_invalidated is set by check_disk_change or in add_disk to initiate a
partition scan.  Move it from check_disk_size_change which is called
from both revalidate_disk() and bdev_disk_changed() to only the latter,
as that is what is called from the block device open code (and nbd) to
deal with the bd_invalidated event.  revalidate_disk() on the other hand
is mostly used to propagate a size update from the gendisk to the block
device, which is entirely unrelated.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 653cd534
...@@ -1302,7 +1302,6 @@ static void check_disk_size_change(struct gendisk *disk, ...@@ -1302,7 +1302,6 @@ static void check_disk_size_change(struct gendisk *disk,
} }
i_size_write(bdev->bd_inode, disk_size); i_size_write(bdev->bd_inode, disk_size);
} }
bdev->bd_invalidated = 0;
spin_unlock(&bdev->bd_size_lock); spin_unlock(&bdev->bd_size_lock);
if (bdev_size > disk_size) { if (bdev_size > disk_size) {
...@@ -1391,6 +1390,8 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate) ...@@ -1391,6 +1390,8 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate)
lockdep_assert_held(&bdev->bd_mutex); lockdep_assert_held(&bdev->bd_mutex);
bdev->bd_invalidated = 0;
rescan: rescan:
ret = blk_drop_partitions(bdev); ret = blk_drop_partitions(bdev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment