diff options
author | Christian Brauner <brauner@kernel.org> | 2024-02-06 18:18:43 +0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-02-08 20:41:03 +0300 |
commit | 386dc41cf54dcf44ea40de1aca900f02b756cec0 (patch) | |
tree | 5e8a1d08c186c3081133848e5468109ccb0d2c13 /init/initramfs.c | |
parent | 6613476e225e090cc9aad49be7fa504e290dd33d (diff) | |
download | linux-386dc41cf54dcf44ea40de1aca900f02b756cec0.tar.xz |
init: flush async file closing
When unpacking the initramfs or when mounting block devices we need to
ensure that any delayed fput() finished to prevent spurious errors.
The init process can be a proper kernel thread or a user mode helper.
In the latter case PF_KTHREAD isn't set. So we need to do both
flush_delayed_work() and task_work_run().
Since we'll port block device opening and closing to regular file open
and closing we need to ensure the same as for the initramfs. So just
make that a little helper.
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Srikanth Aithal <sraithal@amd.com>
Link: https://lore.kernel.org/r/CA+G9fYttTwsbFuVq10igbSvP5xC6bf_XijM=mpUqrJV=uvUirQ@mail.gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'init/initramfs.c')
-rw-r--r-- | init/initramfs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/init/initramfs.c b/init/initramfs.c index 76deb48c38cb..6554f28fa2da 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -16,9 +16,10 @@ #include <linux/mm.h> #include <linux/namei.h> #include <linux/init_syscalls.h> -#include <linux/task_work.h> #include <linux/umh.h> +#include "do_mounts.h" + static __initdata bool csum_present; static __initdata u32 io_csum; @@ -736,8 +737,7 @@ done: initrd_start = 0; initrd_end = 0; - flush_delayed_fput(); - task_work_run(); + init_flush_fput(); } static ASYNC_DOMAIN_EXCLUSIVE(initramfs_domain); |