]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - block/bfq-cgroup.c
block: bvec_nr_vecs() returns value for wrong slab
[mirror_ubuntu-bionic-kernel.git] / block / bfq-cgroup.c
index da1525ec4c87560a447d2698b5ee30bff13a9c1c..c5d8142368c70e0aaa6fbda915777b2b6d90882b 100644 (file)
@@ -775,10 +775,11 @@ static void bfq_pd_offline(struct blkg_policy_data *pd)
        unsigned long flags;
        int i;
 
+       spin_lock_irqsave(&bfqd->lock, flags);
+
        if (!entity) /* root group */
-               return;
+               goto put_async_queues;
 
-       spin_lock_irqsave(&bfqd->lock, flags);
        /*
         * Empty all service_trees belonging to this group before
         * deactivating the group itself.
@@ -809,6 +810,8 @@ static void bfq_pd_offline(struct blkg_policy_data *pd)
        }
 
        __bfq_deactivate_entity(entity, false);
+
+put_async_queues:
        bfq_put_async_queues(bfqd, bfqg);
 
        spin_unlock_irqrestore(&bfqd->lock, flags);
@@ -910,7 +913,8 @@ static ssize_t bfq_io_set_weight(struct kernfs_open_file *of,
        if (ret)
                return ret;
 
-       return bfq_io_set_weight_legacy(of_css(of), NULL, weight);
+       ret = bfq_io_set_weight_legacy(of_css(of), NULL, weight);
+       return ret ?: nbytes;
 }
 
 #ifdef CONFIG_DEBUG_BLK_CGROUP