summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2012-03-29 10:09:44 +0200
committerBen Hutchings <ben@decadent.org.uk>2013-06-29 04:06:34 +0100
commitc32f3410245d666c5bea0e3b6e1e8aad6091b19f (patch)
treedc6905664b804681ba560d23150d1fd59d9aaba9 /drivers/block
parente24fb4d67f53530038a9711d0c1f65937490bb8c (diff)
virtio-blk: Call revalidate_disk() upon online disk resize
commit e9986f303dc0f285401de28cf96f42f4dd23a4a1 upstream. 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> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
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 166cb3683348..c5f7b2cb6633 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -343,6 +343,7 @@ static void virtblk_config_changed_work(struct work_struct *work)
cap_str_10, cap_str_2);
set_capacity(vblk->disk, capacity);
+ revalidate_disk(vblk->disk);
done:
mutex_unlock(&vblk->config_lock);
}