Skip to content

Commit

Permalink
[PATCH] block layer: elv_iosched_show should get elv_list_lock
Browse files Browse the repository at this point in the history
elv_iosched_show function iterates other elv_list, hence
elv_list_lock should be got.

Signed-off-by: Vasily Tarasov <[email protected]>
Signed-off-by: Vasily Tarasov <[email protected]>
  • Loading branch information
Vasily Tarasov authored and Jens Axboe committed Oct 12, 2006
1 parent e6e80f2 commit c584164
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
struct list_head *entry;
int len = 0;

spin_lock_irq(q->queue_lock);
spin_lock_irq(&elv_list_lock);
list_for_each(entry, &elv_list) {
struct elevator_type *__e;

Expand All @@ -1095,7 +1095,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
else
len += sprintf(name+len, "%s ", __e->elevator_name);
}
spin_unlock_irq(q->queue_lock);
spin_unlock_irq(&elv_list_lock);

len += sprintf(len+name, "\n");
return len;
Expand Down

0 comments on commit c584164

Please sign in to comment.