mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-25 21:46:50 +00:00
fix(windows): handle zfs volume paths (#3157)
* fix(windows): handle zfs volume paths * fix(windows): address volume path review * refactor(windows): share fallback path resolution --------- Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -689,8 +689,39 @@ fn validate_local_physical_disk_independence(pools: &[Endpoints]) -> Result<()>
|
||||
let canonical = match rustfs_utils::canonicalize(path) {
|
||||
Ok(path) => path,
|
||||
Err(err) if err.kind() == ErrorKind::NotFound => {
|
||||
missing_paths.push(path.clone());
|
||||
continue;
|
||||
// On Windows, canonicalize can fail for ZFS volumes, junction points,
|
||||
// subst drives, and other non-standard mounts. Try absolutize as fallback.
|
||||
#[cfg(windows)]
|
||||
{
|
||||
match crate::disk::endpoint::windows_fallback_local_path(path, &err, "disk independence validation") {
|
||||
Ok(absolute) => {
|
||||
let abs_path = absolute.to_string_lossy().into_owned();
|
||||
match rustfs_utils::os::get_physical_device_ids(&abs_path) {
|
||||
Ok(ids) => {
|
||||
for device_id in ids {
|
||||
device_paths.entry(device_id).or_default().insert(abs_path.clone());
|
||||
}
|
||||
}
|
||||
Err(device_err) => {
|
||||
return Err(Error::other(format!(
|
||||
"failed to inspect physical disk for local endpoint '{abs_path}' after fallback path resolution: {device_err}"
|
||||
)));
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
Err(fallback_err) => {
|
||||
return Err(Error::other(format!(
|
||||
"failed to resolve local endpoint path '{path}' for disk validation: {err}; fallback resolution failed: {fallback_err}"
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(windows))]
|
||||
{
|
||||
missing_paths.push(path.clone());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
return Err(Error::other(format!(
|
||||
|
||||
Reference in New Issue
Block a user