From 48c8e0f2965116e15b5ad5e91fc3c9fb83d98f1e Mon Sep 17 00:00:00 2001 From: Fupan Li Date: Wed, 25 Jun 2025 09:54:03 +0800 Subject: [PATCH] runtime-rs: fix the issue return the wrong volume In the pre commit:74eccc54e7b31cc4c9abd8b6e4007c3a4c1d4dd4, it missed return the right rootfs volume. In the is_block_rootfs fn, if the rootfs is based on a block device such as devicemapper, it should clear the volume's source and let the device_manager to use the dev_id to get the device's host path. Signed-off-by: Fupan Li --- src/runtime-rs/crates/resource/src/rootfs/block_rootfs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime-rs/crates/resource/src/rootfs/block_rootfs.rs b/src/runtime-rs/crates/resource/src/rootfs/block_rootfs.rs index 70b0ab7b7..905b06461 100644 --- a/src/runtime-rs/crates/resource/src/rootfs/block_rootfs.rs +++ b/src/runtime-rs/crates/resource/src/rootfs/block_rootfs.rs @@ -150,7 +150,7 @@ pub(crate) fn is_block_rootfs(m: &Mount) -> Option<(u64, Mount)> { //clear the volume resource thus the block device will use the dev_id //to find the device's host path; volume.source = String::new(); - return Some((dev_id, m.clone())); + return Some((dev_id, volume)); } if SFlag::from_bits_truncate(fstat.st_mode) == SFlag::S_IFREG