]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - block/bfq-cgroup.c
block: avoid setting none scheduler if it's already none
[mirror_ubuntu-bionic-kernel.git] / block / bfq-cgroup.c
index da1525ec4c87560a447d2698b5ee30bff13a9c1c..d819dc77fe659e0adce9d8b4dd5107d47f2aae67 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);