feat(ecstore): enforce local disk topology guardrails and expose device ids (#2679)

This commit is contained in:
houseme
2026-04-25 14:02:02 +08:00
committed by GitHub
parent 80413e0f8e
commit 1e9c75a201
12 changed files with 506 additions and 10 deletions
+11 -2
View File
@@ -176,7 +176,15 @@ impl LocalDisk {
let root = root_clone.clone();
Box::pin(async move {
match get_disk_info(root.clone()).await {
Ok((info, root)) => {
Ok((info, root_disk)) => {
let physical_device_ids = match rustfs_utils::os::get_physical_device_ids(root.to_string_lossy().as_ref())
{
Ok(ids) => ids,
Err(err) => {
warn!(root = ?root, error = ?err, "failed to resolve physical device ids for disk root");
Vec::new()
}
};
let disk_info = DiskInfo {
total: info.total,
free: info.free,
@@ -186,7 +194,8 @@ impl LocalDisk {
major: info.major,
minor: info.minor,
fs_type: info.fstype,
root_disk: root,
root_disk,
physical_device_ids,
id: disk_id,
..Default::default()
};
+2
View File
@@ -596,6 +596,8 @@ pub struct DiskInfo {
pub scanning: bool,
pub endpoint: String,
pub mount_path: String,
/// Leaf physical block devices backing this mount path when available.
pub physical_device_ids: Vec<String>,
pub id: Option<Uuid>,
pub rotational: bool,
pub metrics: DiskMetrics,