Fix error handling in OverlayFsType by propagating lookup errors

This commit is contained in:
Marsman1996 2026-01-21 13:14:33 +08:00 committed by Tate, Hongliang Tian
parent 6a61aa39b0
commit 5792b49722
1 changed files with 2 additions and 6 deletions

View File

@ -1184,12 +1184,8 @@ impl FsType for OverlayFsType {
let upper = path_resolver.lookup(&FsPath::try_from(upper)?)?;
let lower = lower
.iter()
.map(|&lower| {
path_resolver
.lookup(&FsPath::try_from(lower).unwrap())
.unwrap()
})
.collect();
.map(|&lower| path_resolver.lookup(&FsPath::try_from(lower)?))
.collect::<Result<Vec<_>>>()?;
let work = path_resolver.lookup(&FsPath::try_from(work)?)?;
OverlayFs::new(upper, lower, work).map(|fs| fs as _)