Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick 1736 and 1740 to develop #1738

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions io-engine/src/grpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,14 @@ pub async fn acquire_subsystem_lock<'a>(
if let Some(resource) = resource {
match subsystem.lock_resource(resource.to_string(), None, true).await {
Some(lock_guard) => Ok(lock_guard),
None => Err(Status::already_exists(format!(
None => Err(Status::aborted(format!(
"Failed to acquire lock for the resource: {resource}, lock already held"
))),
}
} else {
match subsystem.lock(None, true).await {
Some(lock_guard) => Ok(lock_guard),
None => Err(Status::already_exists(format!(
None => Err(Status::aborted(format!(
"Failed to acquire subsystem lock: {subsystem:?}, lock already held",
))),
}
Expand Down
14 changes: 9 additions & 5 deletions io-engine/src/host/blk_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ impl From<Property<'_>> for u64 {
// Determine the type of devices which may be potentially presented
// as "available" for use.
fn usable_device(devmajor: &u32) -> bool {
const DEVICE_TYPES: [u32; 4] = [
7, // Loopback devices
8, // SCSI disk devices
43, // Network block devices
const DEVICE_TYPES: [u32; 20] = [
7, // Loopback devices
8, // SCSI disk devices
43, // Network block devices
// START 240-254 block
240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253,
254, // END
255, // Reserved
259, // Block Extended Major
];

Expand Down Expand Up @@ -230,7 +234,7 @@ fn new_filesystem(

// Create a new BlockDevice object from collected information.
// This function also contains the logic for determining whether
// or not the device that this represents is "available" for use.
// the device that this represents is "available" for use.
fn new_device(
parent: Option<&str>,
include: bool,
Expand Down