Skip to content

Commit

Permalink
elevator: don't sort reads between writes
Browse files Browse the repository at this point in the history
Don't allow elv_dispatch_sort() to mix reads and writes together,
it's rarely a good idea.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Jens Axboe authored and Jens Axboe committed Feb 11, 2007
1 parent cad9751 commit 783660b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ void elv_dispatch_sort(request_queue_t *q, struct request *rq)
list_for_each_prev(entry, &q->queue_head) {
struct request *pos = list_entry_rq(entry);

if (rq_data_dir(rq) != rq_data_dir(pos))
break;
if (pos->cmd_flags & (REQ_SOFTBARRIER|REQ_HARDBARRIER|REQ_STARTED))
break;
if (rq->sector >= boundary) {
Expand Down

0 comments on commit 783660b

Please sign in to comment.