Skip to content

Commit

Permalink
Merge pull request #294 from microsoft/danmihai1/unknown-mount-flag
Browse files Browse the repository at this point in the history
agent: avoid "unknown mount flag" for tardev
  • Loading branch information
danmihai1 authored Jan 16, 2025
2 parents 6e3fd0a + 1a0437e commit 8e9238e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/libs/kata-sys-util/src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,25 @@ fn parse_mount_flags(mut flags: MsFlags, flag_str: &str) -> Option<MsFlags> {
"silent" => flags |= MsFlags::MS_SILENT,
"strictatime" => flags |= MsFlags::MS_STRICTATIME,
"sync" => flags |= MsFlags::MS_SYNCHRONOUS,
"io.katacontainers.fs-opt.block_device=file" => return None,
"io.katacontainers.fs-opt.is-layer" => return None,
"io.katacontainers.fs-opt.layer-src-prefix=/var/lib/containerd/io.containerd.snapshotter.v1.tardev/layers" => return None,
"io.katacontainers.fs-opt.overlay-rw" => return None,
flag_str => {
let ignored_prefixes = [
"io.katacontainers.fs-opt.root-hash=",
"io.katacontainers.fs-opt.layer=",
"lowerdir=",
"upperdir=",
"workdir=",
];

for p in &ignored_prefixes {
if flag_str.starts_with(p) {
return None;
}
}

warn!(sl!(), "BUG: unknown mount flag: {:?}", flag_str);
return None;
}
Expand Down

0 comments on commit 8e9238e

Please sign in to comment.