Skip to content

Commit

Permalink
blocK: Restore barrier support for md and probably other virtual devi…
Browse files Browse the repository at this point in the history
…ces.

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 99360b4
but notes in the comments that it is otherwise meaningless).

Cc: Ken Milmore <[email protected]>
Cc: [email protected]
Signed-off-by: NeilBrown <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
neilbrown authored and Jens Axboe committed Jul 1, 2009
1 parent 018e044 commit db64f68
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,11 @@ static int __make_request(struct request_queue *q, struct bio *bio)
const int unplug = bio_unplug(bio);
int rw_flags;

if (bio_barrier(bio) && bio_has_data(bio) &&
(q->next_ordered == QUEUE_ORDERED_NONE)) {
bio_endio(bio, -EOPNOTSUPP);
return 0;
}
/*
* low level driver can indicate that it wants pages above a
* certain limit bounced to low memory (ie for highmem, or even
Expand Down Expand Up @@ -1470,11 +1475,6 @@ static inline void __generic_make_request(struct bio *bio)
err = -EOPNOTSUPP;
goto end_io;
}
if (bio_barrier(bio) && bio_has_data(bio) &&
(q->next_ordered == QUEUE_ORDERED_NONE)) {
err = -EOPNOTSUPP;
goto end_io;
}

ret = q->make_request_fn(q, bio);
} while (ret);
Expand Down

0 comments on commit db64f68

Please sign in to comment.