From: Yu Kuai yukuai3@huawei.com
hulk inclusion category: bugfix bugzilla: 188033, https://gitee.com/openeuler/kernel/issues/I663ZP CVE: NA
--------------------------------
iocost is based on rq_qos, which can only work for request based device, thus it doesn't make sense to configure iocost for bio based device.
Signed-off-by: Yu Kuai yukuai3@huawei.com Reviewed-by: Christoph Hellwig hch@lst.de Signed-off-by: Li Nan linan122@huawei.com Reviewed-by: Hou Tao houtao1@huawei.com --- block/blk-iocost.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/block/blk-iocost.c b/block/blk-iocost.c index c87320fa221e..07f2bb4d4d11 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -3166,6 +3166,10 @@ static ssize_t ioc_qos_write(struct kernfs_open_file *of, char *input, disk = blkcg_conf_get_disk(&input); if (IS_ERR(disk)) return PTR_ERR(disk); + if (!queue_is_mq(disk->queue)) { + ret = -EOPNOTSUPP; + goto err; + }
ioc = q_to_ioc(disk->queue); if (!ioc) { @@ -3333,6 +3337,10 @@ static ssize_t ioc_cost_model_write(struct kernfs_open_file *of, char *input, disk = blkcg_conf_get_disk(&input); if (IS_ERR(disk)) return PTR_ERR(disk); + if (!queue_is_mq(disk->queue)) { + ret = -EOPNOTSUPP; + goto err; + }
ioc = q_to_ioc(disk->queue); if (!ioc) {