Message ID | alpine.LNX.2.00.1510301441210.17538@pobox.suse.cz (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 81335f6..c0bc520 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h @@ -59,6 +59,8 @@ static inline bool try_to_freeze_unsafe(void) static inline bool try_to_freeze(void) { + WARN_ON(current->flags & PF_KTHREAD); + if (!(current->flags & PF_NOFREEZE)) debug_check_no_locks_held(); return try_to_freeze_unsafe(); diff --git a/kernel/freezer.c b/kernel/freezer.c index a8900a3..fe2afb9 100644 --- a/kernel/freezer.c +++ b/kernel/freezer.c @@ -164,6 +164,7 @@ void __thaw_task(struct task_struct *p) bool set_freezable(void) { might_sleep(); + WARN_ON(current->flags & PF_KTHREAD); /* * Modify flags while holding freezer_lock. This ensures the