summaryrefslogtreecommitdiffstats
path: root/Documentation/lguest
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-03-30 21:55:25 -0600
committerRusty Russell <rusty@rustcorp.com.au>2009-03-30 21:55:26 +1030
commitd1881d3192a3d3e8dc4f255b03187f4c36cb0617 (patch)
tree851f74b371136a85226d4180f84b4904762abb0d /Documentation/lguest
parentdf1693abc42e34bbc4351e179dbe66c28a94efb8 (diff)
downloadlinux-d1881d3192a3d3e8dc4f255b03187f4c36cb0617.tar.gz
linux-d1881d3192a3d3e8dc4f255b03187f4c36cb0617.tar.bz2
linux-d1881d3192a3d3e8dc4f255b03187f4c36cb0617.zip
lguest: barrier me harder
Impact: barrier correctness in example launcher I doubt either lguest user will complain about performance. Reported-by: Christoph Hellwig <hch@infradead.org> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'Documentation/lguest')
-rw-r--r--Documentation/lguest/lguest.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index f2dbbf3bdeab..d36fcc0f2715 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -1630,6 +1630,13 @@ static bool service_io(struct device *dev)
}
}
+ /* OK, so we noted that it was pretty poor to use an fdatasync as a
+ * barrier. But Christoph Hellwig points out that we need a sync
+ * *afterwards* as well: "Barriers specify no reordering to the front
+ * or the back." And Jens Axboe confirmed it, so here we are: */
+ if (out->type & VIRTIO_BLK_T_BARRIER)
+ fdatasync(vblk->fd);
+
/* We can't trigger an IRQ, because we're not the Launcher. It does
* that when we tell it we're done. */
add_used(dev->vq, head, wlen);