xfs: inode recovery does not validate the recovered inode
[platform/kernel/linux-rpi.git] / kernel / cgroup / legacy_freezer.c
index 122dacb..66d1708 100644 (file)
@@ -66,9 +66,15 @@ static struct freezer *parent_freezer(struct freezer *freezer)
 bool cgroup_freezing(struct task_struct *task)
 {
        bool ret;
+       unsigned int state;
 
        rcu_read_lock();
-       ret = task_freezer(task)->state & CGROUP_FREEZING;
+       /* Check if the cgroup is still FREEZING, but not FROZEN. The extra
+        * !FROZEN check is required, because the FREEZING bit is not cleared
+        * when the state FROZEN is reached.
+        */
+       state = task_freezer(task)->state;
+       ret = (state & CGROUP_FREEZING) && !(state & CGROUP_FROZEN);
        rcu_read_unlock();
 
        return ret;