Skip to content

Commit

Permalink
fix: fix error message when different pool found
Browse files Browse the repository at this point in the history
currently when the name of the pool on the disk, and the name of
pool we are trying to import mismatches, the error message contains
wrong pool name. This change fixes the pool name in case of an errored
pool import

Signed-off-by: Akhil Mohan <[email protected]>
  • Loading branch information
akhilerm authored and tiagolobocastro committed Jun 8, 2022
1 parent 3f33933 commit 62b80b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mayastor/src/lvs/lvs_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,11 @@ impl Lvs {

if name != lvs.name() {
warn!("no pool with name {} found on this device -- unloading the pool", name);
let pool_name = lvs.name().to_string();
lvs.export().await.unwrap();
Err(Error::Import {
source: Errno::EINVAL,
name: name.into(),
name: pool_name,
})
} else {
lvs.share_all().await;
Expand Down

0 comments on commit 62b80b5

Please sign in to comment.