aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2012-03-29 04:09:44 -0400
committerJens Axboe <axboe@kernel.dk>2012-03-29 04:09:44 -0400
commite9986f303dc0f285401de28cf96f42f4dd23a4a1 (patch)
tree2b13f119efc6984c70b7e3570c8cffde0c1f53c7 /drivers/block
parent6674fb79ca9c19f5ee3d4cd683da2d9e09cfc9b8 (diff)
virtio-blk: Call revalidate_disk() upon online disk resize
If a virtio disk is open in guest and a disk resize operation is done, (virsh blockresize), new size is not visible to tools like "fdisk -l". This seems to be happening as we update only part->nr_sects and not bdev->bd_inode size. Call revalidate_disk() which should take care of it. I tested growing disk size of already open disk and it works for me. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/virtio_blk.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index c4a60badf252..0e4ef3de9d5d 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -351,6 +351,7 @@ static void virtblk_config_changed_work(struct work_struct *work)
351 cap_str_10, cap_str_2); 351 cap_str_10, cap_str_2);
352 352
353 set_capacity(vblk->disk, capacity); 353 set_capacity(vblk->disk, capacity);
354 revalidate_disk(vblk->disk);
354done: 355done:
355 mutex_unlock(&vblk->config_lock); 356 mutex_unlock(&vblk->config_lock);
356} 357}