aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Seppanen2011-08-23 14:25:12 -0500
committerJens Axboe2011-08-24 01:51:34 -0500
commite8037d49835482c9534a9a07bed0d0ea831135ae (patch)
treef4d7f714c8a4165cacdcc83e9c6bfe7efb527a24 /block/blk-sysfs.c
parent89c63a8ef36a621cb6790c1a56c737e6805ad8f4 (diff)
downloadkernel-common-e8037d49835482c9534a9a07bed0d0ea831135ae.tar.gz
kernel-common-e8037d49835482c9534a9a07bed0d0ea831135ae.tar.xz
kernel-common-e8037d49835482c9534a9a07bed0d0ea831135ae.zip
block: Fix queue_flag update when rq_affinity goes from 2 to 1
Commit 5757a6d76cdf 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 <dan.j.williams@intel.com> Reviewed-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Eric Seppanen <eric@purestorage.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r--block/blk-sysfs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 0ee17b5e7fb..e681805cdb4 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -258,11 +258,13 @@ queue_rq_affinity_store(struct request_queue *q, const char *page, size_t count)
258 258
259 ret = queue_var_store(&val, page, count); 259 ret = queue_var_store(&val, page, count);
260 spin_lock_irq(q->queue_lock); 260 spin_lock_irq(q->queue_lock);
261 if (val) { 261 if (val == 2) {
262 queue_flag_set(QUEUE_FLAG_SAME_COMP, q); 262 queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
263 if (val == 2) 263 queue_flag_set(QUEUE_FLAG_SAME_FORCE, q);
264 queue_flag_set(QUEUE_FLAG_SAME_FORCE, q); 264 } else if (val == 1) {
265 } else { 265 queue_flag_set(QUEUE_FLAG_SAME_COMP, q);
266 queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q);
267 } else if (val == 0) {
266 queue_flag_clear(QUEUE_FLAG_SAME_COMP, q); 268 queue_flag_clear(QUEUE_FLAG_SAME_COMP, q);
267 queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q); 269 queue_flag_clear(QUEUE_FLAG_SAME_FORCE, q);
268 } 270 }