* [PATCH] virtio-blk: Call revalidate_disk() upon online disk resize
@ 2012-03-28 20:32 Vivek Goyal
2012-03-29 8:10 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Vivek Goyal @ 2012-03-28 20:32 UTC (permalink / raw)
To: linux kernel mailing list, kvm
Cc: Christoph Hellwig, Rusty Russell, Jens Axboe, Amit Shah,
Moyer Jeff Moyer
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>
---
drivers/block/virtio_blk.c | 1 +
1 file changed, 1 insertion(+)
Index: linux-2.6/drivers/block/virtio_blk.c
===================================================================
--- linux-2.6.orig/drivers/block/virtio_blk.c 2012-03-27 17:05:07.000000000 -0400
+++ linux-2.6/drivers/block/virtio_blk.c 2012-03-28 15:55:03.943462782 -0400
@@ -351,6 +351,7 @@ static void virtblk_config_changed_work(
cap_str_10, cap_str_2);
set_capacity(vblk->disk, capacity);
+ revalidate_disk(vblk->disk);
done:
mutex_unlock(&vblk->config_lock);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] virtio-blk: Call revalidate_disk() upon online disk resize
2012-03-28 20:32 [PATCH] virtio-blk: Call revalidate_disk() upon online disk resize Vivek Goyal
@ 2012-03-29 8:10 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2012-03-29 8:10 UTC (permalink / raw)
To: Vivek Goyal
Cc: linux kernel mailing list, kvm, Christoph Hellwig, Rusty Russell,
Amit Shah, Moyer Jeff Moyer
On 03/28/2012 10:32 PM, Vivek Goyal wrote:
> 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.
Thanks, obviously right. Applied.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-29 8:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-28 20:32 [PATCH] virtio-blk: Call revalidate_disk() upon online disk resize Vivek Goyal
2012-03-29 8:10 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).