[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120328203200.GE3376@redhat.com>
Date: Wed, 28 Mar 2012 16:32:00 -0400
From: Vivek Goyal <vgoyal@...hat.com>
To: linux kernel mailing list <linux-kernel@...r.kernel.org>,
kvm@...r.kernel.org
Cc: Christoph Hellwig <hch@...radead.org>,
Rusty Russell <rusty@...tcorp.com.au>,
Jens Axboe <axboe@...nel.dk>, Amit Shah <amit.shah@...hat.com>,
Moyer Jeff Moyer <jmoyer@...hat.com>
Subject: [PATCH] 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@...hat.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);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists