mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
freezer,umh: Clean up freezer/initrd interaction
handle_initrd() marks itself as PF_FREEZER_SKIP in order to ensure that the UMH, which is going to freeze the system, doesn't indefinitely wait for it's caller. Rework things by adding UMH_FREEZABLE to indicate the completion is freezable. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/r/20220822114648.791019324@infradead.org
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <linux/async.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/initrd.h>
|
||||
#include <linux/freezer.h>
|
||||
|
||||
#include <trace/events/module.h>
|
||||
|
||||
@@ -436,6 +437,9 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait)
|
||||
if (wait == UMH_NO_WAIT) /* task has freed sub_info */
|
||||
goto unlock;
|
||||
|
||||
if (wait & UMH_FREEZABLE)
|
||||
freezer_do_not_count();
|
||||
|
||||
if (wait & UMH_KILLABLE) {
|
||||
retval = wait_for_completion_killable(&done);
|
||||
if (!retval)
|
||||
@@ -448,6 +452,10 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait)
|
||||
}
|
||||
|
||||
wait_for_completion(&done);
|
||||
|
||||
if (wait & UMH_FREEZABLE)
|
||||
freezer_count();
|
||||
|
||||
wait_done:
|
||||
retval = sub_info->retval;
|
||||
out:
|
||||
|
||||
Reference in New Issue
Block a user