Commit a614dd22 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: don't allow writing to the poll queue attribute

The poll attribute is a historic artefact from before when we had
explicit poll queues that require driver specific configuration.
Just print a warning when writing to the attribute.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Tested-by: default avatarMark Wunderlich <mark.wunderlich@intel.com>
Link: https://lore.kernel.org/r/20211012111226.760968-16-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 3e08773c
...@@ -433,26 +433,11 @@ static ssize_t queue_poll_show(struct request_queue *q, char *page) ...@@ -433,26 +433,11 @@ static ssize_t queue_poll_show(struct request_queue *q, char *page)
static ssize_t queue_poll_store(struct request_queue *q, const char *page, static ssize_t queue_poll_store(struct request_queue *q, const char *page,
size_t count) size_t count)
{ {
unsigned long poll_on; if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
ssize_t ret;
if (!q->tag_set || q->tag_set->nr_maps <= HCTX_TYPE_POLL ||
!q->tag_set->map[HCTX_TYPE_POLL].nr_queues)
return -EINVAL; return -EINVAL;
pr_info_ratelimited("writes to the poll attribute are ignored.\n");
ret = queue_var_store(&poll_on, page, count); pr_info_ratelimited("please use driver specific parameters instead.\n");
if (ret < 0) return count;
return ret;
if (poll_on) {
blk_queue_flag_set(QUEUE_FLAG_POLL, q);
} else {
blk_mq_freeze_queue(q);
blk_queue_flag_clear(QUEUE_FLAG_POLL, q);
blk_mq_unfreeze_queue(q);
}
return ret;
} }
static ssize_t queue_io_timeout_show(struct request_queue *q, char *page) static ssize_t queue_io_timeout_show(struct request_queue *q, char *page)
......
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