Skip to content

Commit

Permalink
block: Fix queue_flag update when rq_affinity goes from 2 to 1
Browse files Browse the repository at this point in the history
Commit 5757a6d added the QUEUE_FLAG_SAME_FORCE flag, but fails to
clear that flag when the current state is '2' (SAME_COMP + SAME_FORCE)
and the new state is '1' (SAME_COMP).

Acked-by: Dan Williams <[email protected]>
Reviewed-by: Roland Dreier <[email protected]>
Signed-off-by: Eric Seppanen <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
ericatpure authored and Jens Axboe committed Aug 24, 2011
1 parent 89c63a8 commit e8037d4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions block/blk-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,13 @@ queue_rq_affinity_store(struct request_queue *q, const char *page, size_t count)

ret = queue_var_store(&val, page, count);
spin_lock_irq(q->queue_lock);
if (val) {
if (val == 2) {
queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
if (val == 2)
queue_flag_set(QUEUE_FLAG_SAME_FORCE, q);
} else {
queue_flag_set(QUEUE_FLAG_SAME_FORCE, q);
} else if (val == 1) {
queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q);
} else if (val == 0) {
queue_flag_clear(QUEUE_FLAG_SAME_COMP, q);
queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q);
}
Expand Down

0 comments on commit e8037d4

Please sign in to comment.