From: Keir Fraser Date: Thu, 21 Jan 2010 14:39:05 +0000 (+0000) Subject: blkback: Flush blkback data when connecting. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=35ec9d9f16dd000e9b9119b193ce20bf72f58127;p=legacy%2Flinux-2.6.18-xen.git blkback: Flush blkback data when connecting. First cut at flushing blkback data when first connecting blkback. This should avoid the pygrub issues we are experiencing in (RedHat bugzilla) 466681. Signed-off-by: Chris Lalancette --- diff --git a/drivers/xen/blkback/xenbus.c b/drivers/xen/blkback/xenbus.c index 6a5669e9..82fa267c 100644 --- a/drivers/xen/blkback/xenbus.c +++ b/drivers/xen/blkback/xenbus.c @@ -88,6 +88,13 @@ static void update_blkif_status(blkif_t *blkif) return; } + err = filemap_write_and_wait(blkif->vbd.bdev->bd_inode->i_mapping); + if (err) { + xenbus_dev_error(blkif->be->dev, err, "block flush"); + return; + } + invalidate_inode_pages2(blkif->vbd.bdev->bd_inode->i_mapping); + blkif->xenblkd = kthread_run(blkif_schedule, blkif, name); if (IS_ERR(blkif->xenblkd)) { err = PTR_ERR(blkif->xenblkd);