Skip to content

Commit e947f6c

Browse files
author
CKI KWF Bot
committed
Merge: Backport upstream commit "fs: Add 'initramfs_options' to set initramfs mount options
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7528 JIRA: https://issues.redhat.com/browse/RHEL-121113 Upstream commit 278033a ("fs: Add 'initramfs_options' to set initramfs mount options") allows for passing of options to the initial root file system so that there is more control over allocation of memory for this memory based file system. In the target case the memory requirement of kdump can be significantly reduced so that we will have less OOM issues with kdump. Signed-off-by: Ian Kent <ikent@redhat.com> Approved-by: Brian Foster <bfoster@redhat.com> Approved-by: Miklos Szeredi <mszeredi@redhat.com> Approved-by: Carlos Maiolino <cmaiolino@redhat.com> Approved-by: Andrey Albershteyn <aalbersh@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 8bc08b8 + 068a8e6 commit e947f6c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5765,6 +5765,9 @@
57655765

57665766
rootflags= [KNL] Set root filesystem mount option string
57675767

5768+
initramfs_options= [KNL]
5769+
Specify mount options for for the initramfs mount.
5770+
57685771
rootfstype= [KNL] Set root filesystem type
57695772

57705773
rootwait [KNL] Wait (indefinitely) for root device to show up.

fs/namespace.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ static int __init set_mphash_entries(char *str)
6565
}
6666
__setup("mphash_entries=", set_mphash_entries);
6767

68+
static char * __initdata initramfs_options;
69+
static int __init initramfs_options_setup(char *str)
70+
{
71+
initramfs_options = str;
72+
return 1;
73+
}
74+
75+
__setup("initramfs_options=", initramfs_options_setup);
76+
6877
static u64 event;
6978
static DEFINE_IDA(mnt_id_ida);
7079
static DEFINE_IDA(mnt_group_ida);
@@ -4311,7 +4320,7 @@ static void __init init_mount_tree(void)
43114320
struct mnt_namespace *ns;
43124321
struct path root;
43134322

4314-
mnt = vfs_kern_mount(&rootfs_fs_type, 0, "rootfs", NULL);
4323+
mnt = vfs_kern_mount(&rootfs_fs_type, 0, "rootfs", initramfs_options);
43154324
if (IS_ERR(mnt))
43164325
panic("Can't create rootfs");
43174326

0 commit comments

Comments
 (0)