File tree 2 files changed +15
-7
lines changed
2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ impl MayastorGrpcServer {
90
90
} ) )
91
91
. add_optional_service (
92
92
enable_v1
93
- . map ( |_| v1:: pool:: PoolRpcServer :: new ( PoolService :: new ( ) ) ) ,
93
+ . map ( |_| v1:: pool:: PoolRpcServer :: new ( pool_v1 . clone ( ) ) ) ,
94
94
)
95
95
. add_optional_service ( enable_v1. map ( |_| {
96
96
v1:: replica:: ReplicaRpcServer :: new ( replica_v1. clone ( ) )
Original file line number Diff line number Diff line change @@ -863,11 +863,20 @@ impl Lvs {
863
863
. map ( Lvol :: from_inner_ptr) ?;
864
864
865
865
if let Some ( id) = entity_id {
866
- let mut lvol_mut = Pin :: new ( & mut lvol) ;
867
- lvol_mut. as_mut ( ) . set ( PropValue :: EntityId ( id) ) . await ?;
866
+ if let Err ( error) =
867
+ Pin :: new ( & mut lvol) . set ( PropValue :: EntityId ( id) ) . await
868
+ {
869
+ let lvol_uuid = lvol. uuid ( ) ;
870
+ if let Err ( error) = lvol. destroy ( ) . await {
871
+ warn ! (
872
+ "uuid/{lvol_uuid}: failed to destroy lvol after failing to set entity id: {error:?}" ,
873
+ ) ;
874
+ }
875
+ return Err ( error) ;
876
+ }
868
877
}
869
878
870
- info ! ( "{:?}: wiping super" , lvol ) ;
879
+ info ! ( "{lvol :?}: wiping super" ) ;
871
880
872
881
if let Err ( error) = lvol. wipe_super ( ) . await {
873
882
// If we fail to destroy it hopefully the control-plane will clean
@@ -876,14 +885,13 @@ impl Lvs {
876
885
let lvol_uuid = lvol. uuid ( ) ;
877
886
if let Err ( error) = lvol. destroy ( ) . await {
878
887
warn ! (
879
- "uuid/{}: failed to destroy lvol after failing to wipe super: {:?}" ,
880
- lvol_uuid, error
888
+ "uuid/{lvol_uuid}: failed to destroy lvol after failing to wipe super: {error:?}" ,
881
889
) ;
882
890
}
883
891
return Err ( error) ;
884
892
}
885
893
886
- info ! ( "{:?}: created" , lvol ) ;
894
+ info ! ( "{lvol :?}: created" ) ;
887
895
lvol. event ( EventAction :: Create ) . generate ( ) ;
888
896
Ok ( lvol)
889
897
}
You can’t perform that action at this time.
0 commit comments