net/rds: An rds_sock is added too early to the hash table
[platform/kernel/linux-rpi.git] / block / bfq-wf2q.c
index ae52bff..ff7c2d4 100644 (file)
@@ -1181,10 +1181,17 @@ bool __bfq_deactivate_entity(struct bfq_entity *entity, bool ins_into_idle_tree)
        st = bfq_entity_service_tree(entity);
        is_in_service = entity == sd->in_service_entity;
 
-       if (is_in_service) {
-               bfq_calc_finish(entity, entity->service);
+       bfq_calc_finish(entity, entity->service);
+
+       if (is_in_service)
                sd->in_service_entity = NULL;
-       }
+       else
+               /*
+                * Non in-service entity: nobody will take care of
+                * resetting its service counter on expiration. Do it
+                * now.
+                */
+               entity->service = 0;
 
        if (entity->tree == &st->active)
                bfq_active_extract(st, entity);