[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E48A6A6.4040706@oracle.com>
Date: Mon, 15 Aug 2011 12:55:02 +0800
From: Joe Jin <joe.jin@...cle.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Jens Axboe <jaxboe@...ionio.com>,
Ian Campbell <Ian.Campbell@...citrix.com>
CC: Greg Marsden <greg.marsden@...cle.com>,
Kurt C Hackel <KURT.HACKEL@...cle.com>,
"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Joe Jin <joe.jin@...cle.com>
Subject: [patch] xen-blkback: sync I/O after backend disconnected
When backend disconnect, sync IO requests to the disk.
Signed-off-by: Joe Jin <joe.jin@...cle.com>
Cc: Jens Axboe <jaxboe@...ionio.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc: Ian Campbell <Ian.Campbell@...citrix.com>
---
drivers/block/xen-blkback/xenbus.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index 1a87f5b..da39d61 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -35,6 +35,7 @@ static void connect(struct backend_info *);
static int connect_ring(struct backend_info *);
static void backend_changed(struct xenbus_watch *, const char **,
unsigned int);
+static void xen_vbd_sync(struct xen_vbd *vbd);
struct xenbus_device *xen_blkbk_xenbus(struct backend_info *be)
{
@@ -232,6 +233,7 @@ static void xen_blkif_disconnect(struct xen_blkif *blkif)
free_vm_area(blkif->blk_ring_area);
blkif->blk_rings.common.sring = NULL;
}
+ xen_vbd_sync(&blkif->vbd);
}
void xen_blkif_free(struct xen_blkif *blkif)
@@ -332,6 +334,12 @@ static void xen_vbd_free(struct xen_vbd *vbd)
vbd->bdev = NULL;
}
+static void xen_vbd_sync(struct xen_vbd *vbd)
+{
+ if (vbd->bdev)
+ fsync_bdev(vbd->bdev);
+}
+
static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
unsigned major, unsigned minor, int readonly,
int cdrom)
--
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