diff options
-rw-r--r-- | drivers/block/xen-blkfront.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index c6727b5cefd6..6d912ab47292 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -420,9 +420,19 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size) | |||
420 | static int xlvbd_barrier(struct blkfront_info *info) | 420 | static int xlvbd_barrier(struct blkfront_info *info) |
421 | { | 421 | { |
422 | int err; | 422 | int err; |
423 | unsigned ordered = QUEUE_ORDERED_NONE; | ||
423 | 424 | ||
424 | err = blk_queue_ordered(info->rq, | 425 | /* |
425 | info->feature_barrier ? QUEUE_ORDERED_DRAIN : QUEUE_ORDERED_NONE); | 426 | * If we don't have barrier support, then there's really no |
427 | * way to guarantee write ordering, so we really just have to | ||
428 | * send writes to the backend and hope for the best. If | ||
429 | * barriers are supported then we can treat them as proper | ||
430 | * ordering tags. | ||
431 | */ | ||
432 | if (info->feature_barrier) | ||
433 | ordered = QUEUE_ORDERED_TAG; | ||
434 | |||
435 | err = blk_queue_ordered(info->rq, ordered); | ||
426 | 436 | ||
427 | if (err) | 437 | if (err) |
428 | return err; | 438 | return err; |
@@ -509,8 +519,7 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, | |||
509 | info->rq = gd->queue; | 519 | info->rq = gd->queue; |
510 | info->gd = gd; | 520 | info->gd = gd; |
511 | 521 | ||
512 | if (info->feature_barrier) | 522 | xlvbd_barrier(info); |
513 | xlvbd_barrier(info); | ||
514 | 523 | ||
515 | if (vdisk_info & VDISK_READONLY) | 524 | if (vdisk_info & VDISK_READONLY) |
516 | set_disk_ro(gd, 1); | 525 | set_disk_ro(gd, 1); |