Commit 12508c4a authored by Paolo \'Blaisorblade\' Giarrusso's avatar Paolo \'Blaisorblade\' Giarrusso Committed by Linus Torvalds

[PATCH] uml: avoid using elv_queue_empty

Avoid using, in the UBD driver, the elv_queue_empty function.  It's for the
block layer only; in fact, the Anticipatory Scheduler can return NULL with
elv_next_request() even if the queue is not empty, because it waits for the
process to send another request before seeking on the disk.

In fact, if (with uml-ubd-any-elevator) we let UBD use any scheduler,
elevator=as will make the UBD driver Oops, if we don't have this patch.
Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7e8e597e
......@@ -1038,8 +1038,7 @@ static void do_ubd_request(request_queue_t *q)
int err, n;
if(thread_fd == -1){
while(!elv_queue_empty(q)){
req = elv_next_request(q);
while((req = elv_next_request(q)) != NULL){
err = prepare_request(req, &io_req);
if(!err){
do_io(&io_req);
......@@ -1048,9 +1047,8 @@ static void do_ubd_request(request_queue_t *q)
}
}
else {
if(do_ubd || elv_queue_empty(q))
if(do_ubd || (req = elv_next_request(q)) == NULL)
return;
req = elv_next_request(q);
err = prepare_request(req, &io_req);
if(!err){
do_ubd = ubd_handler;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment