mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-17 17:02:42 +00:00
Merge pull request #11206 from kimullaa/fix-xfs-rootfs-type
runtime: remove wrong xfs options
This commit is contained in:
commit
3dfabd42c2
@ -76,12 +76,15 @@ impl KernelParams {
|
|||||||
VM_ROOTFS_DRIVER_PMEM => {
|
VM_ROOTFS_DRIVER_PMEM => {
|
||||||
params.push(Param::new("root", VM_ROOTFS_ROOT_PMEM));
|
params.push(Param::new("root", VM_ROOTFS_ROOT_PMEM));
|
||||||
match rootfs_type {
|
match rootfs_type {
|
||||||
VM_ROOTFS_FILESYSTEM_EXT4 | VM_ROOTFS_FILESYSTEM_XFS => {
|
VM_ROOTFS_FILESYSTEM_EXT4 => {
|
||||||
params.push(Param::new(
|
params.push(Param::new(
|
||||||
"rootflags",
|
"rootflags",
|
||||||
"dax,data=ordered,errors=remount-ro ro",
|
"dax,data=ordered,errors=remount-ro ro",
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
VM_ROOTFS_FILESYSTEM_XFS => {
|
||||||
|
params.push(Param::new("rootflags", "dax ro"));
|
||||||
|
}
|
||||||
VM_ROOTFS_FILESYSTEM_EROFS => {
|
VM_ROOTFS_FILESYSTEM_EROFS => {
|
||||||
params.push(Param::new("rootflags", "dax ro"));
|
params.push(Param::new("rootflags", "dax ro"));
|
||||||
}
|
}
|
||||||
@ -93,9 +96,12 @@ impl KernelParams {
|
|||||||
VM_ROOTFS_DRIVER_BLK | VM_ROOTFS_DRIVER_BLK_CCW | VM_ROOTFS_DRIVER_MMIO => {
|
VM_ROOTFS_DRIVER_BLK | VM_ROOTFS_DRIVER_BLK_CCW | VM_ROOTFS_DRIVER_MMIO => {
|
||||||
params.push(Param::new("root", VM_ROOTFS_ROOT_BLK));
|
params.push(Param::new("root", VM_ROOTFS_ROOT_BLK));
|
||||||
match rootfs_type {
|
match rootfs_type {
|
||||||
VM_ROOTFS_FILESYSTEM_EXT4 | VM_ROOTFS_FILESYSTEM_XFS => {
|
VM_ROOTFS_FILESYSTEM_EXT4 => {
|
||||||
params.push(Param::new("rootflags", "data=ordered,errors=remount-ro ro"));
|
params.push(Param::new("rootflags", "data=ordered,errors=remount-ro ro"));
|
||||||
}
|
}
|
||||||
|
VM_ROOTFS_FILESYSTEM_XFS => {
|
||||||
|
params.push(Param::new("rootflags", "ro"));
|
||||||
|
}
|
||||||
VM_ROOTFS_FILESYSTEM_EROFS => {
|
VM_ROOTFS_FILESYSTEM_EROFS => {
|
||||||
params.push(Param::new("rootflags", "ro"));
|
params.push(Param::new("rootflags", "ro"));
|
||||||
}
|
}
|
||||||
@ -259,7 +265,7 @@ mod tests {
|
|||||||
expect_params: KernelParams {
|
expect_params: KernelParams {
|
||||||
params: [
|
params: [
|
||||||
Param::new("root", VM_ROOTFS_ROOT_PMEM),
|
Param::new("root", VM_ROOTFS_ROOT_PMEM),
|
||||||
Param::new("rootflags", "dax,data=ordered,errors=remount-ro ro"),
|
Param::new("rootflags", "dax ro"),
|
||||||
Param::new("rootfstype", VM_ROOTFS_FILESYSTEM_XFS),
|
Param::new("rootfstype", VM_ROOTFS_FILESYSTEM_XFS),
|
||||||
]
|
]
|
||||||
.to_vec(),
|
.to_vec(),
|
||||||
@ -272,7 +278,7 @@ mod tests {
|
|||||||
expect_params: KernelParams {
|
expect_params: KernelParams {
|
||||||
params: [
|
params: [
|
||||||
Param::new("root", VM_ROOTFS_ROOT_BLK),
|
Param::new("root", VM_ROOTFS_ROOT_BLK),
|
||||||
Param::new("rootflags", "data=ordered,errors=remount-ro ro"),
|
Param::new("rootflags", "ro"),
|
||||||
Param::new("rootfstype", VM_ROOTFS_FILESYSTEM_XFS),
|
Param::new("rootfstype", VM_ROOTFS_FILESYSTEM_XFS),
|
||||||
]
|
]
|
||||||
.to_vec(),
|
.to_vec(),
|
||||||
|
@ -150,7 +150,11 @@ func GetKernelRootParams(rootfstype string, disableNvdimm bool, dax bool) ([]Par
|
|||||||
kernelRootParams = append(kernelRootParams, Param{"rootflags", "ro"})
|
kernelRootParams = append(kernelRootParams, Param{"rootflags", "ro"})
|
||||||
}
|
}
|
||||||
case XFS:
|
case XFS:
|
||||||
fallthrough
|
if dax {
|
||||||
|
kernelRootParams = append(kernelRootParams, Param{"rootflags", "dax ro"})
|
||||||
|
} else {
|
||||||
|
kernelRootParams = append(kernelRootParams, Param{"rootflags", "ro"})
|
||||||
|
}
|
||||||
// EXT4 filesystem is used by default.
|
// EXT4 filesystem is used by default.
|
||||||
case EXT4:
|
case EXT4:
|
||||||
if dax {
|
if dax {
|
||||||
|
@ -64,7 +64,7 @@ func TestGetKernelRootParams(t *testing.T) {
|
|||||||
rootfstype: string(XFS),
|
rootfstype: string(XFS),
|
||||||
expected: []Param{
|
expected: []Param{
|
||||||
{"root", string(Nvdimm)},
|
{"root", string(Nvdimm)},
|
||||||
{"rootflags", "data=ordered,errors=remount-ro ro"},
|
{"rootflags", "ro"},
|
||||||
{"rootfstype", string(XFS)},
|
{"rootfstype", string(XFS)},
|
||||||
},
|
},
|
||||||
disableNvdimm: false,
|
disableNvdimm: false,
|
||||||
@ -75,7 +75,7 @@ func TestGetKernelRootParams(t *testing.T) {
|
|||||||
rootfstype: string(XFS),
|
rootfstype: string(XFS),
|
||||||
expected: []Param{
|
expected: []Param{
|
||||||
{"root", string(Nvdimm)},
|
{"root", string(Nvdimm)},
|
||||||
{"rootflags", "dax,data=ordered,errors=remount-ro ro"},
|
{"rootflags", "dax ro"},
|
||||||
{"rootfstype", string(XFS)},
|
{"rootfstype", string(XFS)},
|
||||||
},
|
},
|
||||||
disableNvdimm: false,
|
disableNvdimm: false,
|
||||||
@ -86,7 +86,7 @@ func TestGetKernelRootParams(t *testing.T) {
|
|||||||
rootfstype: string(XFS),
|
rootfstype: string(XFS),
|
||||||
expected: []Param{
|
expected: []Param{
|
||||||
{"root", string(VirtioBlk)},
|
{"root", string(VirtioBlk)},
|
||||||
{"rootflags", "data=ordered,errors=remount-ro ro"},
|
{"rootflags", "ro"},
|
||||||
{"rootfstype", string(XFS)},
|
{"rootfstype", string(XFS)},
|
||||||
},
|
},
|
||||||
disableNvdimm: true,
|
disableNvdimm: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user