summaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2018-03-07 17:10:05 -0800
committerJens Axboe <axboe@kernel.dk>2018-03-08 14:13:48 -0700
commit7dfdbc7367f6f789715cab2cb484b78ab45e9f3e (patch)
tree12bb8fc5fe749d47d9948f2a2b502a021fe9dd1d /block/blk-mq.c
parent8814ce8a0f680599a837af18aefdec774e5c7b97 (diff)
downloadlinux-0-day-7dfdbc7367f6f789715cab2cb484b78ab45e9f3e.tar.gz
linux-0-day-7dfdbc7367f6f789715cab2cb484b78ab45e9f3e.tar.xz
block: Protect queue flag changes with the queue lock
Since the queue flags may be changed concurrently from multiple contexts after a queue becomes visible in sysfs, make these changes safe by protecting these with the queue lock. Cc: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Cc: Ming Lei <ming.lei@redhat.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index a868990226839..f5c7dbcb954fb 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2997,7 +2997,7 @@ EXPORT_SYMBOL_GPL(blk_mq_update_nr_hw_queues);
static bool blk_poll_stats_enable(struct request_queue *q)
{
if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags) ||
- test_and_set_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags))
+ blk_queue_flag_test_and_set(QUEUE_FLAG_POLL_STATS, q))
return true;
blk_stat_add_callback(q, q->poll_cb);
return false;