From 48464444be58292e3f89b2ea8666d39e44178573 Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Thu, 22 Jul 2010 14:17:00 -0700 Subject: [PATCH] --- yaml --- r: 208323 b: refs/heads/master c: 4dab46ff26c6003a13ec769312c50938b93c359d h: refs/heads/master i: 208321: fc08775f96c0acff6f9716cc4f894967f42142c8 208319: ed6f948190fd0625473fea9012b92792063c1b7b v: v3 --- [refs] | 2 +- trunk/drivers/block/xen-blkfront.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 25cfba0b16fd..a33b418c0a8c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e96f6abe02fc3320d669985443e8c68ff8e83294 +refs/heads/master: 4dab46ff26c6003a13ec769312c50938b93c359d diff --git a/trunk/drivers/block/xen-blkfront.c b/trunk/drivers/block/xen-blkfront.c index c6727b5cefd6..6d912ab47292 100644 --- a/trunk/drivers/block/xen-blkfront.c +++ b/trunk/drivers/block/xen-blkfront.c @@ -420,9 +420,19 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size) static int xlvbd_barrier(struct blkfront_info *info) { int err; + unsigned ordered = QUEUE_ORDERED_NONE; - err = blk_queue_ordered(info->rq, - info->feature_barrier ? QUEUE_ORDERED_DRAIN : QUEUE_ORDERED_NONE); + /* + * If we don't have barrier support, then there's really no + * way to guarantee write ordering, so we really just have to + * send writes to the backend and hope for the best. If + * barriers are supported then we can treat them as proper + * ordering tags. + */ + if (info->feature_barrier) + ordered = QUEUE_ORDERED_TAG; + + err = blk_queue_ordered(info->rq, ordered); if (err) return err; @@ -509,8 +519,7 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, info->rq = gd->queue; info->gd = gd; - if (info->feature_barrier) - xlvbd_barrier(info); + xlvbd_barrier(info); if (vdisk_info & VDISK_READONLY) set_disk_ro(gd, 1);