diff options
author | NeilBrown <neilb@suse.de> | 2009-06-30 03:35:44 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-07-01 04:56:26 -0400 |
commit | db64f680ba4b5c56c4be59f0698000df89ff0281 (patch) | |
tree | f094e64952ba746525e4695256a70e0d32553065 /block/blk-core.c | |
parent | 018e0446890661504783f92388ecce7138c1566d (diff) |
blocK: Restore barrier support for md and probably other virtual devices.
The next_ordered flag is only meaningful for devices that use __make_request.
So move the test against next_ordered out of generic code and in to
__make_request
Since this test was added, barriers have not worked on md or any
devices that don't use __make_request and so don't bother to set
next_ordered. (dm explicitly sets something other than
QUEUE_ORDERED_NONE since
commit 99360b4c18f7675b50d283301d46d755affe75fd
but notes in the comments that it is otherwise meaningless).
Cc: Ken Milmore <ken.milmore@googlemail.com>
Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 02b87134a167..4b45435c6eaf 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1170,6 +1170,11 @@ static int __make_request(struct request_queue *q, struct bio *bio) | |||
1170 | const int unplug = bio_unplug(bio); | 1170 | const int unplug = bio_unplug(bio); |
1171 | int rw_flags; | 1171 | int rw_flags; |
1172 | 1172 | ||
1173 | if (bio_barrier(bio) && bio_has_data(bio) && | ||
1174 | (q->next_ordered == QUEUE_ORDERED_NONE)) { | ||
1175 | bio_endio(bio, -EOPNOTSUPP); | ||
1176 | return 0; | ||
1177 | } | ||
1173 | /* | 1178 | /* |
1174 | * low level driver can indicate that it wants pages above a | 1179 | * low level driver can indicate that it wants pages above a |
1175 | * certain limit bounced to low memory (ie for highmem, or even | 1180 | * certain limit bounced to low memory (ie for highmem, or even |
@@ -1470,11 +1475,6 @@ static inline void __generic_make_request(struct bio *bio) | |||
1470 | err = -EOPNOTSUPP; | 1475 | err = -EOPNOTSUPP; |
1471 | goto end_io; | 1476 | goto end_io; |
1472 | } | 1477 | } |
1473 | if (bio_barrier(bio) && bio_has_data(bio) && | ||
1474 | (q->next_ordered == QUEUE_ORDERED_NONE)) { | ||
1475 | err = -EOPNOTSUPP; | ||
1476 | goto end_io; | ||
1477 | } | ||
1478 | 1478 | ||
1479 | ret = q->make_request_fn(q, bio); | 1479 | ret = q->make_request_fn(q, bio); |
1480 | } while (ret); | 1480 | } while (ret); |